Top "Exception-handling" questions

An exception is an unusual condition that requires deviation from the program's normal flow.

How can I catch a 404?

I have the following code: HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); request.Method = "HEAD"; request.Credentials = MyCredentialCache; try { request.GetResponse(); } …

c# .net exception-handling error-handling http-status-code-404
Error restoring database backup

I am getting an error using SQL Server 2012 when restoring a backup made with a previous version (SQL Server 2008). I …

sql-server database exception-handling restore sql-server-2012
Exception message (Python 2.6)

In Python, if I open a binary file that doesn't exist, the program exits with an error and prints: Traceback (…

python exception-handling message
Is it okay to throw NullPointerException programmatically?

When there is a post-condition, that return value of a method must not be null, what can be done? I …

java exception-handling nullpointerexception throw
Nullable object must have a value?

On the line: bool travel = fill.travel.Value; I am getting the following error: Nullable object must have a value …

c# .net linq-to-sql exception-handling nullable
Why use finally in C#?

Whatever is inside finally blocks is executed (almost) always, so what's the difference between enclosing code into it or leaving …

c# exception-handling
Difference: std::runtime_error vs std::exception()

What is the difference between std::runtime_error and std::exception? What is the appropriate use for each? Why are …

c++ exception-handling
Oracle PL/SQL: how to get the stack trace, package name and procedure name

Sometimes the exception returns something like: "ORA-06502: PL/SQL: numeric or value error: character string buffer too small". It's not …

oracle exception-handling plsql stack-trace
Will code in a Finally statement fire if I return a value in a Try block?

I'm reviewing some code for a friend and say that he was using a return statement inside of a try-finally …

c# .net exception-handling try-catch
What really happens in a try { return x; } finally { x = null; } statement?

I saw this tip in another question and was wondering if someone could explain to me how on earth this …

c# .net exception-handling