Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 5099

An exception is an occurrence in an application process that requires deviation from the program's normal flow.

2 votes
Accepted

Exception handling for a page with multiple sections

The suggestion of the team to catch the unexpected exceptions in the private functions that each retrieve a section of the page is a very good way to ensure that a failure in one section does not affect …
Bart van Ingen Schenau's user avatar
1 vote
Accepted

Difference between Exception "Ducking" and "Swallowing"

That tutorial seems to use the term "exception ducking" in a non-conventional way. The code you present is indeed swallowing the exception, by catching it and doing nothing. Ducking an exception mean …
Bart van Ingen Schenau's user avatar
11 votes

Doing work in vector's push back

Whether using such complicated expressions in a push back (or any other function call) is debatable and it depends on two factors: 1. your local coding conventions, and 2. the comfort level of you an …
Bart van Ingen Schenau's user avatar
4 votes
Accepted

Exception class for each exception or for all framework

Such different handling is not really possible when all exceptions have the same type. …
Bart van Ingen Schenau's user avatar
21 votes

Why is there no 'finally' construct in C++?

Within the C++ community there might be more talk about 'exception safe' code, but it is almost equally important in other languages that have exceptions. …
Bart van Ingen Schenau's user avatar
29 votes

Should a C++ program catch all exceptions and prevent exceptions from bubbling up past main()?

The main reason for not letting exceptions escape from main is because otherwise you lose all possibility to control how the problem gets reported to your users. …
Bart van Ingen Schenau's user avatar
4 votes
Accepted

Where should I catch exceptions

There are two reasons for catching an exception To convert the exception to a different exception, so that internal implementation details are not exposed to users of a module. An example could be t …
Bart van Ingen Schenau's user avatar
6 votes
Accepted

Recovering a process after illegal instruction exception

When the processor throws up an illegal instruction error, there are usually so many unknowns about the program state that the easiest way to get into a known-good state is to let the process crash an …
Bart van Ingen Schenau's user avatar
1 vote

Is logging every exception with FirstChanceException event handler a bad practice?

It might be the best way to guarantee that all exceptions get logged. I do have a problem with controllers that consume exceptions without so much as telling the user that their request has failed. …
Bart van Ingen Schenau's user avatar
7 votes
Accepted

Is throwing custom exceptions from private methods OK?

The throws declaration on a public method should document all the exceptions that a caller of that method might have to deal with (or at least be aware of). … That is not just the exceptions thrown by the method itself, but also the exceptions thrown by functions/methods that it calls and which are not handled. …
Bart van Ingen Schenau's user avatar
3 votes
Accepted

Should exception-blocks handle only exceptions raised from try-blocks?

Should the exception blocks in a try-except sequence be specific only to those exceptions which may originate from the try? … Or can they be inclusive of exceptions that may arise from handling the original exception caught? …
Bart van Ingen Schenau's user avatar
2 votes

Is using nested try-except blocks problematic?

Exceptions are meant to be fatal if you don't know how to handle them. And just logging that an exception occurred is not handling the exception. …
Bart van Ingen Schenau's user avatar
2 votes

Having error codes option in C++ library for performance

The choice between exceptions and error codes should not be a global one, but rather based on how exceptional the error condition is with a normal usage of the library. … Exceptions should be used to report serious problems that should not occur with normal usage of the library and that the immediate caller is unlikely to be able to recover from. …
Bart van Ingen Schenau's user avatar
2 votes
Accepted

What's the best way to handle slightly different exceptions?

This option is particularly useful if you might want to differentiate between the different exceptions in your catch clauses. …
Bart van Ingen Schenau's user avatar
10 votes
Accepted

Try Catch and Flow Control dilemma

The relative cost of handling exceptions is the source for the adagio not to use them for flow-control, but what is actually meant is that you should not use exceptions to realize a flow through your program … Exceptions are a perfect tool if you encounter an error and need to bail out of multiple levels of you call stack. …
Bart van Ingen Schenau's user avatar

15 30 50 per page