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)
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*"
Favorites infavorites:mine
Status closed:yes
Types is:question
Exclude -[tag]
For more details on advanced search visit our help page
Results tagged with Search options user 116777

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

What are Exceptions for? (1) Telling the user something went wrong? This should be a last resort, because your code should intercede and show them something "nicer" than an Exception. The …
answered Oct 11 '16 by Phill W.
And this is why I like Java - no such surprises there (every function explicitly tells you what Exceptions it might throw). Wouldn't that be something like this? try: #do stuff except(KeyboardInterrupt): pass else: #handle error …
answered Jan 27 '16 by Phill W.
I have a question regarding the use of exceptions at the highest level of a program. I have seen programs using this strategy and I have also seen posts considering this bad practice … Job. Flow Control - regular call and return. Exceptional stuff that causes havoc - Exceptions. You've got the idea of why to throw Exceptions but I think you're missing the [far] more important …
answered Feb 1 '16 by Phill W.
"Exception Handling". Two little words but which is more important? I would argue, it's the latter. In a critical piece of code, should exceptions describing a situation which does not makes …
answered Jul 18 '16 by Phill W.
Why do you throw Exceptions? To have them caught and handled. How does the catching code work out how to handle the Exception? Using the properties that you define on the Exception object …
answered Nov 24 '16 by Phill W.
might be relevant to you and "throw back" [all] the ones that aren't? Of course not. It's the same with Exceptions. Catch those that you can usefully handle and ignore all the others (let them …
answered Jan 9 by Phill W.
regard it as a "backstop", the "Lowest Common Denominator" of Exception "handling" and, whilst it is the way that a lot of people write code, it's not what Exceptions are really about. An Exception is … by Structured Exception Handling schemes are mostly geared-up to figure out what Type of Exception was thrown and, therefore, which "catch" block it should be directed to. This is why Exceptions are …
answered Mar 27 '14 by Phill W.
Why do you throw Exceptions? Because something's happened that you can't deal with and you need to tell whoever called you that it did, in a well-defined, structured manner. Why do you catch … Exceptions? Because you can can do something useful with/ about them. How can you tell that you can handle a particular Exception? You know what Type it will be so that you can filter that from all …
answered Jan 22 '18 by Phill W.
Java went much further and made Exceptions part of the method contract and, IMHO, that's good. It focuses your thinking about exceptions. When you call a method, you know exactly which exception(s … " might throw these exceptions to your callers. Because it doesn't explicitly do this, .Net has encouraged a lot of lazy, woolly thinking about exceptions, leading to all of the confusion already …
answered Aug 15 '14 by Phill W.
I want to implement the logic of a finally block, but only if no exceptions are thrown A block of code that's run if no Exceptions are thrown? That's just a block of code after everything else …
answered Jul 4 '16 by Phill W.
Methods which throws exceptions are not "honest". You can't recognize if a method is expected to fail or not, by looking at its signature. Compared to [older versions of] Java this was argued to … be one of .Net's biggest failings. Java laces Exceptions right into the Method signature; .Net doesn't. Exception handling adds a lot of boiler plate code. Only when it is done wrongly. You …
answered Jul 17 '19 by Phill W.
... what really should we do to catch all kind of exceptions without showing any error messages to clients? Never showing users an error suggests that the Application is perfect, the Operating … ... Provided that message is meaningful to the User and, preferably, gives them some clue about how to "fix" (or "handle") the problem, then yes. Complete Exceptions (message, stack trace and …
answered Nov 6 '19 by Phill W.
" Exception Handling and think they have to add something so that Exceptions don't "escape" and kill their program. Part of the difficulty here is that, most of the time, this problem won't even get … noticed, because Exceptions aren't being thrown all the time but, when they are, the program is going to waste an awful lot of time and effort gradually unpicking the call stack to get up to somewhere that actually does something useful with the Exception. …
answered May 9 '19 by Phill W.
Short answer is "Both". You might want to trap "errors" early on, throwing out bad data (although whether that's an "Exception" is debatable). You definitely want to throw exception when things go "ba …
answered Oct 2 '15 by Phill W.
As yourself not which is the best to *throw* ... As yourself which is the most useful to *catch*! Why do we have multiple Types of Exception? So that the catching code can handle them differently …
answered Oct 23 '17 by Phill W.

15 30 50 per page