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
0
votes
1 answer

C programming, causing unhandled win32 exception, possibly in strlen function.

My c program, written in the visual-studio 2010, is throwing an unhandled win32 exception. I think it's in a strlen function, based on the debugger output, but I'm not sure. The file I'm reading in is multiple lines with ; used as a delimiter, and…
lsiebert
  • 667
  • 1
  • 5
  • 16
-1
votes
2 answers

How to handle Unhandled exceptions in c# using TryParse

if (response.ToLower() == "addition") { Console.Write("Enter a number: "); double num1 = double.Parse(Console.ReadLine()); Console.Write("Enter another number: "); double num2 = double.Parse(Console.ReadLine()); double addition = (num1) +…
-1
votes
1 answer

Unhandled exception error not showing for a function

I want to restrict my function divide to always be called from a try block. But when the function is called from main, without using try block, it does not show "Unhandled Exception" error? class Main { public static void main(String[] args) { …
-1
votes
1 answer

Input string is not in a correct format error

C# public static int getAge(int yearOfBirth) { int CurrentYear = DateTime.Now.Year; int age = CurrentYear - yearOfBirth; return age; } In this function, I calculate age according to the birth year as an integer. public static void…
-1
votes
4 answers

Error that can't be fixed?

I'm getting an error in my VB.NET application that connects to my SQL database. It connects fine, but for some reason I can't fix this error. When I try to fix it, it moves from one part of my script to another part of my script (both of which were…
daniel11
  • 2,027
  • 10
  • 38
  • 46
-1
votes
1 answer

WPF .NET 5 simple error not caught by DispatcherUnhandledException Event

For a test on unhandled exception I created following simple .NET 5 project hoping that the global DispatcherUnhandledException Event would catch the error, but the error was raised locally and did not trigger the above event. Question: What I may…
nam
  • 21,967
  • 37
  • 158
  • 332
-1
votes
1 answer

How to add File to Array (List) :Flutter

How to add File to Array (List) I got an image from ImagePicker var image = await ImagePicker.pickImage(source: imageSource); _images are declared by followed List _images = List(); I tried as Follows _images = image as…
Kasun Hasanga
  • 1,626
  • 4
  • 15
  • 35
-1
votes
1 answer

Visual studio, debugging randomly throws SEHException unhandled exception in mscorlib.dll with no stackTrace

I've got a C# Windows Forms application that (outside of debug mode) works perfectly. When I run it in debug mode, each action I take has a random chance of crashing the application (like clicking a button, or closing the main form). There is a lot…
The Lemon
  • 1,211
  • 15
  • 26
-1
votes
1 answer

What is the following error doing? I do not see any error with the bounds

The code has a header, implementation, and main files. It is supposed to increment the ASCII value of all characters in the string then return the character value associated with that ASCII value. The code in question is as follows: for(int i…
ADS_Fibonacci
  • 45
  • 1
  • 6
-1
votes
2 answers

C# WPF Dispatcher.UnhandledException fails to catch exception

Inherited WPF application sets up Dispatcher.UnhandledException in App.xaml.cs: public App() : base() { this.Dispatcher.UnhandledException += OnDispatcherUnhandledException; } Except am occasionally getting "program has stopped working" without…
user5505472
-1
votes
1 answer

My code runs fine but breaks while in a game loop

The code below is able to run fine in the debugger but ends up failing to print anything after the while(incorrect) loop as commented at the bottom. Upon finishing the function of the code or guessing everything the code crashes and takes you to the…
Juhpan
  • 11
  • 2
-1
votes
1 answer

Unhandled Exception Access Violation while opening a file stream using fopen_s

I'm having quite a bit of trouble figuring out why my code won't work. The objective of this program is to make a series of random sentences from the given arrays, and to then either output them to the screen or to a text file. I'm not exactly sure…
-1
votes
1 answer

math domain error in python when caluclating angles

trying to calculate all kind of triangle's angles by given sides. I have all the agorithms to do so, one slight problem is having a 'math domain error' which i can't find. Appreciate any help :) from math import * def angles(a, b, c): if a + b…
Elad Goldenberg
  • 99
  • 1
  • 10
-1
votes
2 answers

how post mortem debugger catch even what unhandled exception filter missed

i'm trying to impl some post mortem debugger , means to catch only exception who not handled by the program, so i'm sets unhandled exception filter (and make sure no one set it after me) but i have some cases (e.g in mshtml.dll) that access…
-1
votes
1 answer

Unhandled exception of type 'System.TypeInitializationException' occurred in Unknown Module

For .NET I normally code in VB, but I'm having to work on a project in C#, and bumped into this weird issue. I have 3 classes (Form1, and 2 added classes that call controls and methods on Form1). To make life easier, in Program.cs I added: public…
J. Scott Elblein
  • 4,013
  • 15
  • 58
  • 94