Top "Try-catch" questions

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

Catch any error in Python

Is it possible to catch any error in Python? I don't care what the specific exceptions will be, because all …

python exception exception-handling try-catch fallback
Java exception not caught

Why are some exceptions in Java not caught by catch (Exception ex)? This is code is completely failing out with …

java exception try-catch
Why does a Try/Catch block create new variable scope?

For example: try { SomeObject someObject = new SomeObject(); someObject.dangerousMethod(); } catch(Exception e) { } someObject.anotherMethod(); //can't access someObject! But you can …

java scope try-catch
Where do I put try/catch with "using" statement?

Possible Duplicate: try/catch + using, right syntax I would like to try/catch the following: //write to file using (StreamWriter …

c# try-catch using-statement
New/strange Java "try()" syntax?

While messing around with the custom formatting options in Eclipse, in one of the sample pieces of code, I saw …

java syntax try-catch
Handle error when getimagesize can't find a file

when I'm trying to getimagesize($img) and the image doesn't exist, I get an error. I don't want to first …

php try-catch getimagesize
java try finally block to close stream

I want to close my stream in the finally block, but it throws an IOException so it seems like I …

java file-io stream try-catch finally
Using catch without arguments

What is the difference between: catch { MessageBox.Show("Error."); } and: catch (Exception ex) { MessageBox.Show("Error."); //we never use ex, …

c# try-catch
Java if vs. try/catch overhead

Is there any overhead in Java for using a try/catch block, as opposed to an if block (assuming that …

java exception-handling if-statement try-catch overhead