Top "Try-catch" questions

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

Is it a known good practice to use a big try-catch per method in java?

I've been interviewed recently and the interviewer wanted me to do a technical test to see my knowledge. After I …

java exception-handling try-catch
Call-stack for exceptions in C++

Today, in my C++ multi-platform code, I have a try-catch around every function. In every catch block I add the …

c++ exception callstack try-catch
Try-Catch inside While Loop

The code below asks the user how many racers he/she would like. while (true) { // loops forever until break try { // …

java exception-handling while-loop try-catch inputmismatchexception
How to write an empty indentation block in Python?

The runtime keeps telling me: expected an indented block But I don't want write nothing inside my except block, I …

python syntax try-catch indentation
Catching multiple exceptions at once in Scala

How to catch multiple exceptions at once in Scala? Is there a better way than in C#: Catch multiple exceptions …

exception scala exception-handling pattern-matching try-catch
I am unable to use THROW SQL Server 2008 R2

SQL Server 2008 R2 Management Studio does not recognized my throw in the below example, it says incorrect syntax near Throw …

sql sql-server sql-server-2008-r2 try-catch throw
jQuery: try catch { call function } does not work?

I'm having a lot of JavaScript on my page and I'm using typekit. In order to make my page work …

javascript jquery try-catch typekit
TypeError: node.setAttribute is not a function

I'm getting an error: "TypeError: item.setAttribute is not a function" when I try to call the following function on …

javascript html error-handling try-catch setattribute
error: cannot dynamic_cast ... (target is not pointer or reference)

I'm learning exception handling in C++ and run into a problem. Here's the code: #include<iostream> #include<…

c++ exception try-catch dynamic-cast
What is the benefit to use "finally" after try-catch block in java?

The "finally" block is always executed when the try-catch ends, either in case of exception or not. But also every …

java try-catch finally