Top "Try-catch" questions

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

Catch KeyError in Python

If I run the code: connection = manager.connect("I2Cx") The program crashes and reports a KeyError because I2Cx …

python try-catch except
IsNumeric function in c#

I know it's possible to check whether the value of a text box or variable is numeric using try/catch …

c# function parsing try-catch numeric
Try-Catch-End Try in VBScript doesn't seem to work

I'm trying the following code: Try ' DOESN'T WORK Throw 2 ' How do I throw an exception? Catch ex 'What …

vbscript try-catch
Java Try Catch Finally blocks without Catch

I'm reviewing some new code. The program has a try and a finally block only. Since the catch block is …

java try-catch finally try-catch-finally try-finally
Is it possible in Java to catch two exceptions in the same catch block?

I need to catch two exceptions because they require the same handling logic. I would like to do something like: …

java exception-handling try-catch
Multiple try codes in one block

I have a problem with my code in the try block. To make it easy this is my code: try: …

python exception exception-handling try-catch except
How to efficiently use try...catch blocks in PHP

I have been using try..catch blocks in my PHP code, but I'm not sure if I've been using them …

php exception-handling try-catch
How to catch integer(0)?

Let's say we have a statement that produces integer(0), e.g. a <- which(1:3 == 5) What is the safest way …

r error-handling integer try-catch
How to catch segmentation fault in Linux?

I need to catch segmentation fault in third party library cleanup operations. This happens sometimes just before my program exits, …

c++ segmentation-fault try-catch
Try-catch speeding up my code?

I wrote some code for testing the impact of try-catch, but seeing some surprising results. static void Main(string[] args) { …

c# .net clr try-catch performance-testing