C# - Exception handling in frameworks -


i have write ftp (auth tsl) framework in c#. i'm noob @ writing frameworks.
e.g. when prove file exists , doesn't, should do?

  • throwing exception programmer uses framwork?
  • printing exceptionmessage (console.writeline()) without throwing exception?

what professional in case?

broad question actually, there clues on way:

  1. never use console.writeline() or stuff in framework.
  2. for methods framework.fileexists, if file doesn't exist, return false value. that's true nature of boolean return value. that's more semantic.
  3. for operations encounter problems, throw custom, or predefined exception. example, if need argument , want sure no null has been passed method, check argument in method's body , if it's null, throw argumentnullexception.

Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -