Top "Try-catch" questions

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

How to catch and print the full exception traceback without halting/exiting the program?

I want to catch and log exceptions without exiting, e.g., try: do_stuff() except Exception, err: print(Exception, err) # …

python exception try-catch traceback
Can I catch multiple Java exceptions in the same catch clause?

In Java, I want to do something like this: try { ... } catch (/* code to catch IllegalArgumentException, SecurityException, IllegalAccessException, and NoSuchFieldException at …

java exception try-catch multi-catch
How using try catch for exception handling is best practice

while maintaining my colleague's code from even someone who claims to be a senior developer, I often see the following …

c# .net exception exception-handling try-catch
How to write trycatch in R

I want to write trycatch code to deal with error in downloading from the web. url <- c( "http://…

r exception exception-handling try-catch r-faq
Is it a good practice to use try-except-else in Python?

From time to time in Python, I see the block: try: try_this(whatever) except SomeException as exception: #Handle exception …

python exception exception-handling try-catch
Why catch and rethrow an exception in C#?

I'm looking at the article C# - Data Transfer Object on serializable DTOs. The article includes this piece of code: …

c# exception-handling try-catch
Can I try/catch a warning?

I need to catch some warnings being thrown from some php native functions and then handle them. Specifically: array dns_…

php error-handling try-catch
How do you implement a re-try-catch?

Try-catch is meant to help in the exception handling. This means somehow that it will help our system to be …

java exception exception-handling try-catch
Why is "except: pass" a bad programming practice?

I often see comments on other Stack Overflow questions about how the use of except: pass is discouraged. Why is …

python exception error-handling try-catch
Java Try and Catch IOException Problem

I am trying to use a bit of code I found at the bottom of this page. Here is the …

java try-catch ioexception