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

Design pattern for catching unhandled exceptions in AsyncTask

Folks, I catch unhandled Android exceptions via a code snippet like this, at the top of onCreate: try { File crashLogDirectory = new File(Environment.getExternalStorageDirectory().getCanonicalPath() + Constants.CrashLogDirectory); …
esilver
  • 27,713
  • 23
  • 122
  • 168
8
votes
1 answer

Can Unhandled Exceptions in Child AppDomains be prevented from crashing the main process?

I'm writing a small plugins library which uses app domains to isolate plugins using .Net framework 4.0. Hence the code that goes in each plugin is out of my control. When an unhandled exception is raised in one of the plugins, I have observed the…
Harindaka
  • 4,658
  • 8
  • 43
  • 62
8
votes
2 answers

Getting an Unhandled Exception in VS2010 debugger even though the exception IS handled

I have an issue with VS2010 where the debugger stops with an Unhandled Exception. However, the exception is definitely handled. In fact, if I put code in the catch block, I'll hit it when I press F5. In Debug -> Exceptions, I definitely do not…
Dave
  • 14,618
  • 13
  • 91
  • 145
8
votes
1 answer

Exceptions debugging with async and UWP

I'm working on the UWP application. And I'm using async/await a lot. Always when an exception occurs in my code the debugger set break in App.g.i.cs #if DEBUG && !DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION UnhandledException +=…
IL_Agent
  • 707
  • 3
  • 16
8
votes
2 answers

Why is Visual Studio looping when debugging UnhandledException events

(This looks very similar to C# UnhandledException from another thread keeps looping, but am not trying to catch the exception here, just get the chance to log something) I have some very simple C# code that sets up an UnhandledException event…
Tim Barrass
  • 4,813
  • 2
  • 29
  • 55
8
votes
2 answers

How do I get at the exception information when using MiniDumpWriteDump out-of-process?

When using the MiniDumpWriteDump function to create a core dump of a process on Windows, it is recommended (e.g. here, and here) that the MiniDumpWriteDump is run from another "watchdog" process because it may well not work when called from within…
Martin Ba
  • 37,187
  • 33
  • 183
  • 337
8
votes
3 answers

How to treat unhandled thread-exceptions in ASP.NET?

How is an ASP.NET application supposed to deal with unhandled exceptions which are occuring on a non-request background thread (due to bugs)? By default, such exceptions cause the process to terminate. This is unacceptable in the setting of an…
usr
  • 168,620
  • 35
  • 240
  • 369
7
votes
1 answer

Why an unhandled exception on timer thread doesn't crash the process

I am aware of how unhanded exceptions are processed when using Tasks, only throwing an unhandled in the finalizer if user code hasn't 'observed' it yet. I am also aware of how an unhandled exception in an async thread (e.g. Action.BeginInvoke()) is…
Tyson
  • 14,726
  • 6
  • 31
  • 43
7
votes
1 answer

unhandled exception type error

I have never gotten this error before so I am not sure what to do or what it means Unhandled exception type OperationApplicationException It occurs in this code: public void putSettings(SharedPreferences pref){ …
tyczj
  • 71,600
  • 54
  • 194
  • 296
7
votes
1 answer

Exception User-Unhandled reported in VS Debugger when using Polly

I'm using Polly to catch an exception while calling a Pittney Bowes Geocoder service. I'm using a g1client library that throws a MessageProcessingException. I've wrapped the call in a Polly network policy to retry the call up to 3 times if this…
user2197446
  • 1,065
  • 3
  • 15
  • 31
7
votes
2 answers

Unhandled exceptions in PyQt5

Have a look at the following MWE. import sys from PyQt5.QtWidgets import QMainWindow, QPushButton, QApplication class MainWindow(QMainWindow): def __init__(self, parent=None): super().__init__(parent) self.button =…
polwel
  • 597
  • 5
  • 17
7
votes
6 answers

Exception handling (contradicting documentation / try-finally vs. using)

I thought I had understood how exception handling in C# works. Re-reading the documentation for fun and self-confidence, I have run into problems: This document claims that the following two code snippets are equivalent, even more, that the first…
Binarus
  • 4,005
  • 3
  • 25
  • 41
7
votes
3 answers

Trying to close all opened forms in visual basic

I want it so when my button is clicked, I exit my application. I tried a simple for loop: Private Sub CloseAllToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles CloseAllToolStripMenuItem.Click For Each Form In…
Klink45
  • 439
  • 1
  • 6
  • 21
7
votes
1 answer

Why am I getting an access violation when locking a weak_ptr?

I have a std::weak_ptr. Before attempting to use the underlying object, I lock it in order to get a shared_ptr: auto foo_sharedptr = foo_weakptr.lock(); if (foo_sharedptr != nullptr) { // do stuff with foo } Usually this works fine. However,…
Justin R.
  • 23,435
  • 23
  • 108
  • 157
7
votes
3 answers

How to start activity from UncaughtExceptionHandler if this is main thread crashed?

I am trying to start an error-reporting activty if unhandled exception detected. The problem is with exceptions thrown from main thread. Is there any way to start an activity if main thread crashed?
alex2k8
  • 42,496
  • 57
  • 170
  • 221