Questions tagged [unhandled-exception]

An unhandled exception is an Exception that is thrown by execution but is never caught by the program, which results in a Exception Stack.

An unhandled exception is an Exception that is thrown by execution but is never caught by the program, which results in a Exception Stack.

This could be avoided by catching the exception in a try-catch statement, but it is not always appropriate to catch every possible exception. Sometimes the exception is the result of the client making a mistake rather than something that occurred where it is thrown, therefore the client should be informed of the exception. Most of the time however, it is user friendly to not propagate exceptions.

Read more here.

762 questions
7
votes
2 answers

An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll

Every time I hit the calculate button I receive the following message: An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll Additional information: Input string was not in a correct format. I'm supposed to display a…
Syntax_Error
  • 101
  • 1
  • 2
  • 10
7
votes
1 answer

c++ Unhandled exception - how to debug

I have a problem when running a testcase in debug-mode: I get a pop-up-box with the message "Unhandled exception at 0x7c812fd3 in Test.exe: 0xE0000003: 0xe0000003.". The code breaks in free.c: void __cdecl _free_base (void * pBlock) { int retval…
Svend Andreasen
  • 173
  • 1
  • 8
7
votes
1 answer

Face Recognition in Video using OpenCV gives unhandled exception

I am trying to use the Face Recognition in video sample provided with OpenCV. The only modification I've done is: Instead of using command line arguments to provide CSV and Cascade classifier paths, I have given them directly in the code. This is…
Karan Thakkar
  • 414
  • 2
  • 9
  • 26
7
votes
12 answers

The type initializer for 'CrystalDecisions.Shared.SharedUtils' threw an exception

I'm working on a project and have run into an issue. When I run my code I get this error message: The type initializer for 'CrystalDecisions.Shared.SharedUtils' threw an exception The title of the message is "TypeInitializerException was…
woods
  • 243
  • 4
  • 10
  • 20
6
votes
2 answers

What controls the default UnhandledException policy in WinForms?

I am currently maintaining a WinForms application that listens to the Application.ThreadException event to trap unhandled exceptions on GUI threads. Now things have been working as expected until recently. But lately, this event is no longer being…
Ani
  • 111,048
  • 26
  • 262
  • 307
6
votes
2 answers

Can I Add a handler to AppDomain.CurrentDomain.UnhandledException in a class library

I want to subscribe to the AppDomain.CurrentDomain.UnhandledException event to catch any errors as im trying a new design pattern where I dont want to put a try catch on every event. usually in a win forms app there is a main entry point, but this…
WraithNath
  • 17,658
  • 10
  • 55
  • 82
6
votes
2 answers

Event.preventDefault does not seem to work (async context)

I realise there are a few questions about preventDefault not working. But my question is about the rather straightforward case where you have an async function and an error is thrown: throw 'error of some kind'; ... and then you want to have a…
mike rodent
  • 14,126
  • 11
  • 103
  • 157
6
votes
1 answer

Persist log across Docker container restarts

So I have a microservice running as a Docker container under .NET Core and logging to Application Insights on Azure as it writes large amounts of data fetched from EventHub to a SQL Server. Every once in a while I get an unhandled SqlException that…
6
votes
2 answers

Unhandled rejection error Bluebird

I have the following code. And it works as expected without throwing a unhandled rejection error. p = new Promise (fulfill, reject) -> reject new Error 'some error' p.catch (error) -> console.log error Now, the second code example does throw…
6
votes
4 answers

Can I set Eclipse to ignore "Unhandled exception type"

Is it possible to get Eclipse to ignore the error "Unhandled exception type"? In my specific case, the reason being that I have already checked if the file exists. Thus I see no reason to put in a try catch statement. file = new…
ChaosPixy
  • 73
  • 1
  • 1
  • 5
6
votes
3 answers

Best way to catch all unhandled exceptions in all Tomcat (GWT) servlets

I use Tomcat 7 and Lo4j for all my server logs and GWT for client (only AJAX calls). All my unhandled exceptions get logged in my catalina.log. Now I want to catch all exceptions and add some of the user's specific Tomcat SessionData. There are…
Hollerweger
  • 975
  • 1
  • 13
  • 32
6
votes
2 answers

Unhandled Error with CreateProcess

I was reading about CreateProcess function in c++ and I wanted to try it. Basic idea of the code is to have my main execute another process (notepad). Really, it’s just the basic code. When I run the program, I get: First-chance exception at…
5
votes
1 answer

Unhandled exception after reading histogram (created with calcHist)

I am trying to get histogram from my color (3-channel) image in OpenCV but every time I do the calcHist histogram like this : //int histSize[3]; //float hranges[2]; //const float* ranges[3]; //int channels[3]; ColorHistogram::ColorHistogram() { …
Patryk
  • 22,602
  • 44
  • 128
  • 244
5
votes
3 answers

Unhandled Exceptions in C# Class Library for Logging Purposes

I am new to software development and also new to stackoverflow, so go easy on me. BACKGROUND: I am developing a C# class library that processes xml messages sent by a third party application over tcp/ip (using Async sockets). I am using com-interop…
5
votes
0 answers

.Net Framework: Finally block is not being called when the exception is not being caught

A simple console application, in Visual Studio 2019, .Net Framework 4.7, Windows: static void Main(string[] args) { try { Console.WriteLine("In try"); throw new IndexOutOfRangeException(); } finally { *//…