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

How to avoid crashing while calling function throwing exception from .so

Here is what I did, I want to gracefully handle this exception: code_snippet: my.cpp #include extern "C" void some_func() { throw "(Exception Thrown by some_func!!)"; } code_snippet: exception.c #include extern void…
pankiii
  • 435
  • 3
  • 9
4
votes
1 answer

Strange errors in my Asp.Net MVC 3 site

On my Asp.Net MVC 3 site I have an error logging functionality that sends e-mails to me whenever there's an unhandled error on the site. But recently I have been getting strange errors like the following: The controller for path…
Anders
  • 12,556
  • 24
  • 104
  • 151
4
votes
2 answers

unhandled socket exception with no internet connection when i set timeout duration

I use simple method to get some data from internet 'http get request' : `Future getUser(int userId) async { UserModel user; try { final response = await http.get( "$_baseUrl/users/$userId", …
4
votes
1 answer

Can a .NET 3.5 Compact Framework have a global error handler?

Is there any way to write an error handler for all otherwise unhandled exceptions in a .NET CF 3.5 app? I don't see any kind of OnError event (or any events) on the compact Application class. Searching on google only seems to bring up references to…
4
votes
2 answers

In JUnit, will @After method run, when @Test method throws an exception which is unhandled?

How will I make sure that my @After method runs even if @Test method throws an exception which is unhandled or this is actually internally done by JUnit?
AlwaysNoob
  • 75
  • 2
  • 9
4
votes
1 answer

MVC Error: model item of type 'System.Collections.Generic.IEnumerable`1 required

I'm doing some modifications to a system, and I've run into an exception that I was hoping someone could help with?? The error I'm getting is the following: Exception Details: System.InvalidOperationException: The model item passed into the…
109221793
  • 16,477
  • 38
  • 108
  • 160
4
votes
1 answer

unhandledexception C#

I have this piece of code, I'm using a timer to call my RunTest() function. If I don't use timer, all the unhandled exception inside RunTest() are caught, but with this timer code they are not getting caught. What mistake am I making? private static…
4
votes
0 answers

WPF Expander ScrollViewer throwing exception when window is closed

I'm showing an expander in a modal window. If I don't toggle the expander the window will close fine. Once I've toggled it and close the window it throws an exception on the invocation…
user48408
  • 3,234
  • 11
  • 39
  • 59
4
votes
3 answers

Exceptions on unmanaged threads in .NET

How do I handle situations when the my app is terminating, using a callback prior to termination? The .NET handlers do not work in the following scenario, is SetUnhandledExceptionHandler the correct choice? It appears to have the shortcomings…
4
votes
2 answers

Implementing Unhandled Exception Handler in C# Unit Tests

I've got some tests and they rely heavily on some shared code that I can't modify. This shared code throws an exception sometimes and I want to be able to handle all uncaught instances of this exception without wrapping every call to the shared code…
Reuben Tanner
  • 5,229
  • 3
  • 31
  • 46
4
votes
2 answers

Handling AppDomain.CurrentDomain.UnhandledException in windows service

I have window service which acts as a sync software. I want to add unhanded exception logging on my service, so I modified my program.cs like this: static class Program { /// /// The main entry point for the application. ///…
Latheesan
  • 23,247
  • 32
  • 107
  • 201
4
votes
5 answers

Why is my UnhandledExceptionFilter not being called on a simple divide by zero?

I am using the following MSVC++ console application code (running on Windows 8.1, Release, Win32) to try and return a top-level exception back to me: #include "stdafx.h" #include #include using namespace std; LONG WINAPI…
Alexandru
  • 12,264
  • 17
  • 113
  • 208
4
votes
1 answer

Catch UnhandledExceptions raised on Threads, Tasks, Timers, ThreadPool threads, and BackgroundWorkers

I have a WPF C# 4.0 application that I'm using to investigate unhandled exception handling. I would like to have just one place in my code that handles unhandled exceptions raised on any thread no matter how the thread was created.In my App.xaml.cs…
user2023861
  • 8,030
  • 9
  • 57
  • 86
4
votes
1 answer

CurrentDomain.UnhandledException is not being thrown in Windows Service

I've setup the UnhandledException to log any exceptions before my service crashes. AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(unhandledException); I'm testing this by throwing and unhandled exception. throw new…
CathalMF
  • 9,705
  • 6
  • 70
  • 106
4
votes
3 answers

Unhandled Exception Type in JAVA

I have a two classes in the same package in JAVA. One class in which I have a constructor an exception I tried to create myself: public class ZooException extends Exception { public ZooException(String error) { super(error); …
user1830307