Correct Use of .NET Exception
- by destructo_gold
What is the correct exception to throw in the following instance?
If, for example, I have a class: Album with a collection of Songs:
List<Song>
And a method within Album to add a Song:
public void AddSong(Song song)
{
songs.Add(song);
}
Should I throw an exception of a user attempts to add a song that already exists? If so, what…