I have to write a FTP (AUTH TSL) framework in C#. I’m a noob at writing frameworks.
E.g. when I prove that a file exists and it doesn’t, what should I do?
- Throwing a Exception for the programmer that uses the framwork?
- Printing a ExceptionMessage (Console.WriteLine()) without throwing a
Exception?
What is professional in this case?
Broad question actually, but there are some clues to get you on the way:
Console.WriteLine()or any stuff like that in a framework.Framework.FileExists, if file doesn’t exist, simply returnfalsevalue. That’s the true nature of the Boolean return value. That’s more semantic.ArgumentNullException.