Click here to Skip to main content
15,887,776 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
when an exception occurs that a method is unable to handle - does the program terminate and show the error number ? where does the error number and information about the error come from ? should the programmer while coding have an idea what kind of exception might occur. if so why does'nt he ensure that exception does not occur .
Posted

1 solution

Good question.

My opinion is that the developer should be handling the exceptions that they are aware of (and perhaps responsible for) at the layer they are working. If they create any new exceptions then they are responsible for passing that data along in their docs so the consumer can handle them properly.

Yes, the developer should always have some idea about what kind of exceptions can occur, but that doe snot mean that they HAVE to handle them ALL. They should however be able to accept them and at very least not die when they happen. It all really depends (hows that for being clear? :) ) on the layer you are working.

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900