Top "Exception" questions

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

The given key was not present in the dictionary. Which key?

Is there a way to get the value of the given key in the following exception in C# in a …

c# exception generics dictionary
Exception from HRESULT: 0x800A03EC Error

I am getting "HRESULT: 0x800A03EC" error when running Excel add-in with following code: Excel.Range rng = ActiveSheet.Cells[…

c# excel exception interop add-in
How to create custom exceptions in Java?

How do we create custom exceptions in Java?

java exception
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
Which exception should I raise on bad/illegal argument combinations in Python?

I was wondering about the best practices for indicating invalid argument combinations in Python. I've come across a few situations …

python exception arguments
django MultiValueDictKeyError error, how do I deal with it

I'm trying to save a object to my database, but it's throwing a MultiValueDictKeyError error. The problems lies within the …

python django exception
How to avoid a System.Runtime.InteropServices.COMException?

In my Microsoft Surface project, I always get a lot of the following exceptions: 'MuReSe.vshost.exe' (Managed (v2.0.50727)): Loaded …

c# .net wpf exception pixelsense
Cannot delete directory with Directory.Delete(path, true)

I'm using .NET 3.5, trying to recursively delete a directory using: Directory.Delete(myPath, true); My understanding is that this should …

c# .net exception io
ASP.NET Core Web API exception handling

I am using ASP.NET Core for my new REST API project after using regular ASP.NET Web API for …

c# exception asp.net-core
When I catch an exception, how do I get the type, file, and line number?

Catching an exception that would print like this: Traceback (most recent call last): File "c:/tmp.py", line 1, in <…

python exception stack-trace traceback