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
24
votes
2 answers

Catch unhandled exceptions from async

When an async method that is awaited upon throws an exception, the exception is stored somewhere and throwing it is delayed. In a WinForms or WPF application, it uses SynchronizationContext.Current to post throwing of the exception. However, in e.g.…
Pieter van Ginkel
  • 29,160
  • 8
  • 71
  • 111
20
votes
5 answers

The finally block is not running on .NET 4.0, why?

Ok this is kind of a weird issue and I am hoping someone can shed some light. I have the following code: static void Main(string[] args) { try { Console.WriteLine("in try"); throw new EncoderFallbackException(); } …
jquery auth
  • 1,267
  • 1
  • 14
  • 24
20
votes
4 answers

exception with no stack trace - how?

We have a service which will log unhandled exceptions at the app domain level (via Log4net). We logged: 2014-01-28 16:49:19,636 ERROR [49] FeedWrapperService - unhandled System.NullReferenceException: Object reference not set to an instance of…
Skym
  • 797
  • 1
  • 8
  • 17
20
votes
3 answers

In ASP.NET MVC what is the best show unhandled exceptions in my view?

I have the following in my web.config: I have a [HandleError] at the top of my HomeController class. To test, I create and…
leora
  • 188,729
  • 360
  • 878
  • 1,366
19
votes
14 answers

Flutter error retrieving device properties for ro.product.cpu.abi

I am new to flutter and have successfully gotten it installed and working on one machine, but when working on this one I am having some issues. It is a fresh install of android studio, flutter, and gradle. The machine is running an updated Windows…
Jmonsky
  • 1,519
  • 1
  • 9
  • 16
19
votes
2 answers

procdump not dumping on unhandled exception

I just started playing around with procdump and and I want to have a full dump of an application when an unhanded second chance exception occurs. According to the documentation I run it likes this: procdump.exe -ma -e -x C:\CrashDumps…
NKnusperer
  • 974
  • 1
  • 11
  • 31
19
votes
2 answers

Catching Unhandled Exceptions in Child Threads in WPF

I have a WPF application that spins off several threads. I have defined a DispatcherUnhandledException event handler in App.xaml.cs that displays a detailed error message, and this handler gets called every time the UI thread encounters an…
Phil
  • 6,561
  • 4
  • 44
  • 69
18
votes
5 answers

catch another process unhandled exception

I wish to know if i can catch the unhandled exceptions thrown by another process which I started using the Process.Start(...) I know i can catch the standered error using this link , but what I want is to catch the error that are usually caught by…
17
votes
2 answers

How to handle MonoDroid uncaught exceptions globally and prevent application from crash

I'm trying to implement valid exception handling in my monodroid app which is written with Xamarin.Android plugin for Visual Studio. I'm trying to handle 2 types of exceptions: at foreground (UI) thread at background (threadpool) thread In both…
Mando
  • 11,414
  • 17
  • 86
  • 167
17
votes
2 answers

AppDomain.CurrentDomain.UnhandledException not firing without debugging

I have a .NET program with an event handler bound to Application.CurrentDomain.UnhandledException. When running the program with debugging, this event fires when an unhandled exception is thrown. However, when running without debugging, the event…
AndrewL
  • 3,126
  • 5
  • 31
  • 33
15
votes
1 answer

What happens if an unhandled exception is thrown in Application_Start?

... will the Application_Start method be ran again for the next request(s) or not? Does it depend on ASP.NET version, hosting server version and/or other context? I am trying to determine if it's a good thing to load critical assemblies there or…
Andrei Rînea
  • 20,288
  • 17
  • 117
  • 166
14
votes
1 answer

How to handle currentDomain.UnhandledException in MSTest

I tried to implement solution based on answer How to handle exceptions raised in other threads when unit testing?, but I still don't understand what to do in the handler. Let's suppose I have a test: [TestMethod] void Test() { new Thread(() => {…
Tomas Kubes
  • 23,880
  • 18
  • 111
  • 148
14
votes
3 answers

Infinite loop invalidating the TimeManager

I am experiencing a very tricky defect in my WPF application to track down. The error message is: An infinite loop appears to have resulted from repeatedly invalidating the TimeManager during the Layout/Render process. The stack trace (for what…
Mike Malter
  • 1,018
  • 1
  • 14
  • 38
13
votes
4 answers

Prevent outer exception from being discarded when thrown from BeginInvoke

I have a handler for Application.ThreadException, but I'm finding that exceptions aren't always getting passed to it correctly. Specifically, if I throw an exception-with-inner-exception from a BeginInvoke callback, my ThreadException handler…
Joe White
  • 94,807
  • 60
  • 220
  • 330
12
votes
2 answers

How to catch a global error with NodeJS

I am getting an unhandled error but not sure where it's coming from. My app has several http.request(options, callback).end() in different methods, with the callback's trapping "uncaughtException" and "error". I'd like to know which of my methods…
user603749
  • 1,638
  • 2
  • 24
  • 36
1
2
3
50 51