C# noob question…
I’m taking a few arguments in a class constructor to initialize some private variables. What should I do when the data passed in is not what I expect (wrong string length, numbers out of expected range, nonexisting path, stuff like that..)? Throw an exception? Add “everything went ok” flag?
how is it usually done?
Throw an ArgumentException.
See this related question for more detail:
What's a good way for a c# dll to return error to the calling application?