Top "Try-catch" questions

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

Check whether a string is parsable into Long without try-catch?

Long.parseLong("string") throws an error if string is not parsable into long. Is there a way to validate the …

java string parsing try-catch
Is it bad practice to return from within a try catch finally block?

So I came across some code this morning that looked like this: try { x = SomeThingDangerous(); return x; } catch (Exception ex) { …

c# try-catch try-catch-finally
How to catch the fatal error: Maximum execution time of 30 seconds exceeded in PHP

I've been playing around with a system I'm developing and managed to get it to cause this: Fatal error: Maximum …

php try-catch fatal-error
Throw a format exception C#

I'm trying to throw a format exception in the instance someone tries to enter a non-integer character when prompted for …

c# try-catch formatexception
Java InputMismatchException

I have this code and I want to catch the letter exception but it keeps having these errors: Exception in …

java exception-handling while-loop try-catch mismatch
Why should I not wrap every block in "try"-"catch"?

I have always been of the belief that if a method can throw an exception then it is reckless not …

exception language-agnostic try-catch
Catching an exception that is nested into another exception

I want to catch an exception, that is nested into another exception. I'm doing it currently this way: } catch (RemoteAccessException …

java exception try-catch nested-exceptions
Writing try catch finally in shell

Is there a linux bash command like the java try catch finally? Or does the linux shell always go on? …

shell syntax try-catch finally
How To Check If A Method Exists At Runtime In Java?

How would one go about checking to see if a method exists for a class in Java? Would a try {...} …

java methods try-catch exists
JAVA + try catch(FileNotFoundException e) going in catch(Exception e)?

I have some command which creates a file on disk. Because the folder in which the file has to be …

java try-catch filenotfoundexception