Top "Try-catch" questions

try-catch is a syntactic construct for catching exceptions raised by a code section

Difference between try-finally and try-catch

What's the difference between try { fooBar(); } finally { barFoo(); } and try { fooBar(); } catch(Throwable throwable) { barFoo(throwable); // Does something with throwable, …

java try-catch try-finally
try/catch + using, right syntax

Which one: using (var myObject = new MyClass()) { try { // something here... } catch(Exception ex) { // Handle exception } } OR try { using (var myObject = …

c# try-catch using-statement
How do I prevent node.js from crashing? try-catch doesn't work

From my experience, a php server would throw an exception to the log or to the server end, but node.…

node.js crash try-catch production-environment
Try/catch in Java

Could someone please give me a hint why this try and catch is not working? It throws a scanner exception …

java exception exception-handling try-catch java.util.scanner
Use tryCatch skip to next value of loop upon error?

I've read a few other SO questions about tryCatch and cuzzins, as well as the documentation: Exception handling in R …

r error-handling exception-handling try-catch
python try:except:finally

# Open new file to write file = None try: file = open(filePath, 'w') except IOError: msg = ("Unable to create file on …

python exception file-io try-catch
Try catch in a JUnit test

I'm writing unit tests for an application that already exists for a long time. Some of the methods I need …

java unit-testing junit try-catch
How does the try catch finally block work?

In C#, how does a try catch finally block work? So if there is an exception, I know that it …

c# try-catch try-catch-finally
Why is try {...} finally {...} good; try {...} catch{} bad?

I have seen people say that it is bad form to use catch with no arguments, especially if that catch …

c# .net exception-handling try-catch try-catch-finally
Catching java.lang.OutOfMemoryError?

Documentation for java.lang.Error says: An Error is a subclass of Throwable that indicates serious problems that a reasonable …

java try-catch out-of-memory