I understand that this is a very broad question, but a short “it depends” kind of answer will not be accepted. Strategies are born to deal with broad issues.
What issues should an application designer take into consideration when devising the error and exception handling strategy?
How the strategy will differ depending on the software type (COTS, in-house business app, consultingware, game, hosted web app, embedded etc)? Is the software type important?
Ethical, political and legal issues?
Various perspectives on error handling (user, developer, business support, management).
Some ideas that I would have explored:
Various error reporting routes (i.e. UI, logging, automatic admin notification).
Defence in depth and robustness (failover contingency and fail-safe mechanisms, recovery against problems that are not yet known).
Treating users and customers fairly (i.e. minimising the impact on software users and other people serviced by software).
I'm looking for a similar list of ideas and concepts.
Please do use comments to point me out if I need to clarify the question further and thanks to everyone contributing!
FAQ
Development Platform (Java, .NET, mobile) — will definitely have some affect on the resulting implementation detail of the strategy from a developer perspective but less so from users' point of view.
Fools day it is certainly not. Most legacy systems I was asked to work on did not have a clear error handling strategy.
Could this be made a community wiki? No. It seems as a good question and good questions are hard to come up with.
What do you mean by the strategy? A long term plan that gives direction, focus, brings consistency and coordination to error and exception handling. In case of a larger team working on software the strategy can be formilised and distributed in a written form.
It seems to be duplicate question (see Best practices for exception management in Java or C and Which and why do you prefer exceptions or return codes) These questions deal with a certain perspective on error handling (mostly developer), I'd like to learn more about other perspectives and how they contribute to the overall strategy.
Common Rules of Error HandlingMinimize the usage of static-length buffers. Use dynamic allocation or appropriate classes instead. Write readable code. Use standard or already defined error codes if it is possible.
There are three types of error in programming which are discusses below : Syntax error. Logical error. Runtime error.
Exception handling in C++ consists of three keywords: try, throw and catch: The try statement allows you to define a block of code to be tested for errors while it is being executed. The throw keyword throws an exception when a problem is detected, which lets us create a custom error.
There are so many possible answers here, but I'll take a crack at it.
What issues should an application designer take into consideration when devising the error and exception handling strategy?
How the strategy will differ depending on the software type (COTS, in-house business app, consultingware, game, hosted web app, embedded etc)? Is the software type important?
Ethical, political and legal issues?
The only thing I can think of here would be for desktop apps - "phone home" type applications are generally frowned upon, especially if they submit information about the users machine that could be sensitive.
Various perspectives on error handling (user, developer, business support, management).
From a user perspective, try to avoid errors by designing the interface in such a way that it is difficult for them to make mistakes. Don't ask questions that the user probably won't be able to answer (Abort, Retry, Fail anyone?)
From a developer perspective, you'll want as much information as possible to help diagnose what happened - stack trace, environment info, etc.
From a business support & management standpoint, they'll want to know what to do about the error (mostly in an enterprise environment) - who is responsible for the application (who do I call/page/etc?) as well as the criticality and any possible side effects (e.g. if this batch job fails, what business processes will that affect?). Written documentation is your friend here.
I'm coming from a Java background, but my response should apply to .Net, as well.
Rules of thumb:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With