When should you consider Exception Handling strategy?
Answers
Answered by
8
★ Exceptions are meant for, well, exceptional cases. What this means is anytime there's a case where a code will cause abnormal failures, you should use exception handling. Like for user input, what happens if the user enters an unexpected value? Tries to divide by zero? What happens if there's an action in your code that could cause an abnormal state to occur (referencing null, accessing an array index out of bounds, tries to access/modify a file that doesn't exist or that doesn't have proper permissions)? These are things you, as the programmer, should be considering. Not all of these have to be program terminating errors, but only if your design addresses things properly.
Answered by
17
Exception handling strategy is basically used in programming language of mechanisms,where exception means to denote a specific structure of a particular data which is suppose to be storing all the information in the exceptional conditions.It depends if any of the systems are without the exceptions then the routines would require a special code for error.
Similar questions
Math,
7 months ago
Social Sciences,
7 months ago
Chemistry,
7 months ago
Accountancy,
1 year ago
English,
1 year ago
When exceptions are encountered in testing
Never
When exceptions are encountered in Production