tagged [exception]
What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it?
What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? What does `ArrayIndexOutOfBoundsException` mean and how do I get rid of it? Here is a code sample that triggers the exce...
- Modified
- 7 May at 11:54
Throwing a Win32Exception
Throwing a Win32Exception I've been writing a lot of code recently that involves interop with the Win32 API and have been starting to wonder what's the best way to deal with native (unmanaged) errors ...
- Modified
- 29 Apr at 08:57
Handling a timeout error in Python sockets
Handling a timeout error in Python sockets I am trying to figure out how to use the and to handle a socket timeout. ``` from socket import * def main(): client_socket = socket(AF_INET,SOCK_DGRAM) ...
- Modified
- 27 Apr at 19:49
How do I check if a variable exists?
How do I check if a variable exists? I want to check if a variable exists. Now I'm doing something like this: Are there other ways without exceptions?
jQuery Ajax error handling, show custom exception messages
jQuery Ajax error handling, show custom exception messages Is there some way I can show custom exception messages as an alert in my jQuery AJAX error message? For example, if I want to throw an except...
Catch exception and continue try block in Python
Catch exception and continue try block in Python Can I return to executing the `try` block after exception occurs? For example: vs.
What is the intended use of the optional "else" clause of the "try" statement in Python?
What is the intended use of the optional "else" clause of the "try" statement in Python? What is the intended use of the optional `else` clause of the `try` statement?
What is a good way to handle exceptions when trying to read a file in python?
What is a good way to handle exceptions when trying to read a file in python? I want to read a .csv file in python. - - Is there a prettier way to do it?
- Modified
- 27 Feb at 20:32
Handling two WebException's properly
Handling two WebException's properly I am trying to handle two different `WebException`'s properly. Basically they are handled after calling `WebClient.DownloadFile(string address, string fileName)` A...
- Modified
- 17 Feb at 12:21
Proper way to declare custom exceptions in modern Python?
Proper way to declare custom exceptions in modern Python? What's the proper way to declare custom exception classes in modern Python? My primary goal is to follow whatever standard other exception cla...
How to log formatted message, object array, exception?
How to log formatted message, object array, exception? What is the correct approach to log both a populated message and a stack trace of the exception? I'd like to produce an output similar to this: `...
Elegantly handle task cancellation
Elegantly handle task cancellation When using tasks for large/long running workloads that I need to be able to cancel I often use a template similar to this for the action the task executes: ``` publi...
- Modified
- 3 Dec at 01:37
Rethrowing previous exception inside ContinueWith
Rethrowing previous exception inside ContinueWith ###Intro After puzzling over my code for a while, I discovered that exceptions don't propagate through `ContinueWith`: In this
- Modified
- 18 Nov at 10:49
How to exclude specific exception types from Serilog?
How to exclude specific exception types from Serilog? I am using Serilog to log information about an `asp.net core 2.1` application hosted on IIS. When exceptions occur, I am informed by email. The th...
- Modified
- 15 Nov at 20:18
What is a watson information/bucket?
What is a watson information/bucket? I was reading [Microsoft document on ExceptionDispatchInfo Class](https://msdn.microsoft.com/en-us/library/system.runtime.exceptionservices.exceptiondispatchinfo(v...
- Modified
- 31 Oct at 23:25
How to avoid a "object reference not set to an instance of an object" exception in XAML code at design time?
How to avoid a "object reference not set to an instance of an object" exception in XAML code at design time? I have a problem with a wpf usercontrol which is of my own devising. The problem is that I ...
- Modified
- 30 Oct at 07:47
How can I handle the warning of file_get_contents() function in PHP?
How can I handle the warning of file_get_contents() function in PHP? I wrote a PHP code like this But when I remove "http://" from `$site` I get the following warning: > Warning: file_get_contents(ww...
- Modified
- 4 Oct at 13:18
Declare a method that always throws an exception?
Declare a method that always throws an exception? I have a method like: This produces a compiler error, "not all code paths return a value". But in my case ThrowSpecificFault() will always throw (the ...
- Modified
- 4 Oct at 09:57
InvalidCastException for two Objects of the same type
InvalidCastException for two Objects of the same type I have this weird problem that I cannot handle myself. A class in the model of my mvp-project designed as singleton causes an `InvalidCastExceptio...
- Modified
- 8 Sep at 22:50
What is a StackOverflowError?
What is a StackOverflowError? What is a `StackOverflowError`, what causes it, and how should I deal with them?
- Modified
- 13 Aug at 17:7
How to see exception detail in debugger without assigning variable to exception?
How to see exception detail in debugger without assigning variable to exception? I want to see exception detail in visual studio debugger without assigning variable to exception. Currently I have to w...
- Modified
- 20 Jul at 14:53
What is the proper way to rethrow an exception in C#?
What is the proper way to rethrow an exception in C#? Is it better to do this: Or this: Do they do the same thing? Is one better than the other?
Catch a thread's exception in the caller thread?
Catch a thread's exception in the caller thread? I'm very new to Python and multithreaded programming in general. Basically, I have a script that will copy files to another location. I would like this...
- Modified
- 5 Jul at 13:41
How can I throw an exception in C?
How can I throw an exception in C? I typed this into Google, but I only found how-tos in C++. How can I do it in C?
How can I solve "java.lang.NoClassDefFoundError"?
How can I solve "java.lang.NoClassDefFoundError"? I've tried both the examples in Oracle's [Java Tutorials](http://docs.oracle.com/javase/tutorial). They both compile fine, but at run time, both come ...
- Modified
- 26 May at 09:58