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 103708

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

0 votes

Displaying exceptions

Option 1 mixes up the application logic and UI, as you've noted. It also fouls up internationalization of the application, as the message is hard-coded into the application code. Option 2 just moves …
Simon B's user avatar
  • 9,716
155 votes
Accepted

Exception propagation: When should I catch exceptions?

As a general principle, don't catch exceptions unless you know what to do with them. … Otherwise, catching exceptions at the wrong level tends to result in code that silently fails without providing any useful feedback to the calling code (and ultimately the user of the software). …
Simon B's user avatar
  • 9,716