Click here to Skip to main content
15,881,424 members

Survey Results

Which of the following issues are best handled using Exceptions?

Survey period: 9 Feb 2015 to 16 Feb 2015

Exception handling provides a way to deal with any unexpected or exceptional situations. Define "unexpected".

OptionVotes% 
My bad code (null reference, divide by zero, index out of range etc)53645.85
Errors due to failed network connection70260.05
External Resource (eg webservice) not found or available66556.89
Backend server fails (eg internal database or cache server goes down)70560.31
Local resource access fails (eg can't open a file)63254.06
Timeout (database, file access, network connection)65556.03
Invalid parameter values36731.39
Invalid data supplied by the user30225.83
Respondents were allowed to choose more than one answer; totals may not add up to 100%



 
GeneralWell... Pin
#realJSOP13-Feb-15 5:22
mve#realJSOP13-Feb-15 5:22 
GeneralRe: Well... Pin
H.Brydon13-Feb-15 13:09
professionalH.Brydon13-Feb-15 13:09 
GeneralIt depends on the used language Pin
Daniel Lieberwirth (BrainInBlack)13-Feb-15 1:49
professionalDaniel Lieberwirth (BrainInBlack)13-Feb-15 1:49 
GeneralOnly unpredictable errors PinPopular
Węgierski.A12-Feb-15 4:14
Węgierski.A12-Feb-15 4:14 
GeneralCListCtrl Pin
megaadam11-Feb-15 13:33
professionalmegaadam11-Feb-15 13:33 
GeneralExceptions are NOT control flow logic... Pin
kdmote11-Feb-15 10:07
kdmote11-Feb-15 10:07 
GeneralMessage Removed Pin
11-Feb-15 4:45
professionalN_tro_P11-Feb-15 4:45 
GeneralRe: Quite the variance Pin
H.Brydon13-Feb-15 13:05
professionalH.Brydon13-Feb-15 13:05 
GeneralMessage Removed Pin
17-Feb-15 7:50
professionalN_tro_P17-Feb-15 7:50 
AnswerNo entry for 'none of the above' PinPopular
H.Brydon10-Feb-15 12:43
professionalH.Brydon10-Feb-15 12:43 
GeneralRe: No entry for 'none of the above' Pin
PIEBALDconsult12-Feb-15 9:58
mvePIEBALDconsult12-Feb-15 9:58 
GeneralInvalid... PinPopular
Nelek10-Feb-15 10:06
protectorNelek10-Feb-15 10:06 
GeneralNone of the list qualifies as exceptions PinPopular
Cristian Amarie9-Feb-15 23:40
Cristian Amarie9-Feb-15 23:40 
GeneralRe: None of the list qualifies as exceptions Pin
Ștefan-Mihai MOGA10-Feb-15 0:10
professionalȘtefan-Mihai MOGA10-Feb-15 0:10 
GeneralRe: None of the list qualifies as exceptions PinPopular
Daniel Pfeffer10-Feb-15 2:45
professionalDaniel Pfeffer10-Feb-15 2:45 
GeneralRe: None of the list qualifies as exceptions Pin
Cristian Amarie10-Feb-15 3:14
Cristian Amarie10-Feb-15 3:14 
3 - If the current module does not know what to do, it can either return an error code to caller (and log an error), or pass local error info along with error to upper call. If nobody knows what to do with the data, we don't crash the program, but finish with error.
1 (An error (or other fault)) is too generic.
Errors can occur at any time, suppose you read a JSON (last of my examples) but the file is not ANSI, but UTF-8. This (Jansson's json_loadf, for clarity) is not an exception, it simply means "we do not know how to read BOM marker".
Fault - depends what do you mean. If fault means program flow disruption or program starting affecting other unrelated data, it is an exception (that's why KeBugCheckEx exists).
2 - Equally valid responses can exists. Suppose you need to do two allocations and either can fail with ENOMEM. The result is indeed ENOMEM, but we don't know which one failed. And we do not need to know - ENOMEM is enough. (Not sure if this was a good example, though).
GeneralRe: None of the list qualifies as exceptions Pin
VadimAlk10-Feb-15 15:54
VadimAlk10-Feb-15 15:54 
GeneralRe: None of the list qualifies as exceptions Pin
Cristian Amarie10-Feb-15 18:29
Cristian Amarie10-Feb-15 18:29 
GeneralRe: None of the list qualifies as exceptions Pin
VadimAlk12-Feb-15 12:37
VadimAlk12-Feb-15 12:37 
GeneralExceptions should only used when low-level code has no reasonable way to handle the error Pin
Daniel Pfeffer9-Feb-15 22:14
professionalDaniel Pfeffer9-Feb-15 22:14 
GeneralRe: Exceptions should only used when low-level code has no reasonable way to handle the error Pin
Cristian Amarie9-Feb-15 23:42
Cristian Amarie9-Feb-15 23:42 
GeneralRe: Exceptions should only used when low-level code has no reasonable way to handle the error Pin
Daniel Pfeffer10-Feb-15 2:35
professionalDaniel Pfeffer10-Feb-15 2:35 
GeneralRe: Exceptions should only used when low-level code has no reasonable way to handle the error Pin
Cristian Amarie10-Feb-15 3:17
Cristian Amarie10-Feb-15 3:17 
GeneralRe: Exceptions should only used when low-level code has no reasonable way to handle the error Pin
Daniel Pfeffer10-Feb-15 20:46
professionalDaniel Pfeffer10-Feb-15 20:46 
GeneralAll of the above Pin
Ainy Mughal9-Feb-15 20:49
Ainy Mughal9-Feb-15 20:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.