error handling best practices

J

joe

MaksimKneller said:
Under which circumstances is it best to report/record errors via:

- exceptions
- returning an enum indicating success/fail
- just writing the error to a log

The first 2 are propogation techniques while the last one is a handling
option. Your question is malformed.
 
G

Goran Pusic

The first 2 are propogation techniques while the last one is a handling
option. Your question is malformed.

Best response so far! Except that better word for 3) is "reporting"
option. :)

Goran.
 
J

joe

Goran said:
Best response so far! Except that better word for 3) is "reporting"
option. :)

Indeed. I realized I had written the wrong category the next day whereas
usually I'm all over this stuff. In a nutshell, to get errors under
control, one has to understand and address all of the following:
identification/categorization, detection, propagation, handling,
reporting. The first step (identification/categorization) is analysis of
what kinds of errors the program/system will encounter and helps plan the
other stages in the "error lifecycle".

I probably subliminally avoided saying "reporting" in my OP because some
people use it to mean propagation. Perhaps "notification" would be a
better word, but maybe not since that is a means of reporting just like
logging is... oh well.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,153
Latest member
NamKaufman
Top