exception

Custom oracle exceptions through JDBC

In a stored procedure I have used to; raise_application_error (-20010, 'My Message'); to raise a custom error in a certain situation. What I am trying to do is when I make my JDBC call from java, to be able to identify this error as not just being a SQLException so that I can handle it differently. I though I could identify it by the ...

java.net.SocketException: Software caused connection abort: recv failed; Causes and cures?

Hi, all. I've got an application running on Apache Tomcat 5.5 on a Win2k3 VM. The application serves up XML to be consumed by some telephony appliances as part of our IVR infrastructure. The application, in turn, receives its information from a handful of SOAP services. This morning, the SOAP services were timing out intermittently, ...

How to display error type in ruby?

Hello, in the following code begin raise StandardError, 'message' #some code that raises a lot of exception rescue StandardError #handle error rescue OtherError #handle error rescue YetAnotherError #handle error end I want to print a warning stating the type and the message of the error without adding print statement to each of t...

Getting traceback information from IronPython exceptions

I have IronPython hosted within my application, whenever I catch an exception thrown from a script, I get unhelpful gibberish like this: IronPython.NewTypes.System.Exception_1$1: Error occurred during conversion ---> Microsoft.Scripting.ArgumentTypeException: expected int, got DispMethod at _stub_$245##245(Closure , CallSite , Object...

Handling nil exceptions in objective-c

Hey all I'm using a MPMoviePlayerController and trying to catch my exception when there is no movie present. movies = [movieDictionary objectForKey:@"movieID"]; NSLog(@"callVideoSetting"); CGRect playfram = CGRectMake(0, 0, 320, 500); stopButton = [UIButton buttonWithType:UIButtonTypeCustom]; [stopButton setFrame:playfram]; [stopButt...

Set InnerException of .NET Exception object

How can I set the InnerException property of an Exception object, while I'm in the constructor of that object? This boils down to finding and setting the backing field of a property that has no setter. If your answer is this cannot be done, don't answer please! I'm saying this because it should be possible via reflection, so if you kn...

Debug.Assert vs Exception Throwing

I've read plenty of articles (and a couple of other similar questions that were posted on StackOverflow) about how and when to you assertions, and I understood them well. But still, I don't understand what kind of motivation should drive me to use Debug.Assert instead of throwing a plain exception. What I mean is, in .Net the default res...

Complexity of Exceptions

I am playing around with C++ code in my spare time, working on putting together a library that could be used somewhat generically for building RPG type games. Mostly it is focusing on the underlying data structures and functions. I am still a long ways off from working with graphics. My question is this: How complicated should except...

catch exceptions in Codegear CBuilder 2007 Forms

Hi, I have the problem to catch an EInOutError exception in CBuilder 2007 that is thrown inside an AsyncPro component. I have put a "try" statement around the Application->CreateForm() calls, but this covers only up to the constructor of the classes. From there the Forms run in their own thread and exceptions are not catched. Does anybo...

How to know which processes is using a file under ASP.NET?

I'm developing a multi-threaded ASP.NET 3.5 application, during working with some file, I'm getting the following exception : The process cannot access the file because it is being used by another process I'm looking for a way to know exactly which process is locking that file so I can stop its access to the file. OR if that i...

WPF global exception handler

Hi, sometimes, under not reproducible circumstances, my WPF application crashes without any message. The application simply close instantly. Where is the best place to implement the global Try/Catch block. At least i have to implement a messagebox with: "Sorry for the inconvenience ..." Any help would be most welcome, thank you. ...

what happens to a python object when you throw an exception from it

My class contains a socket that connects to a server. Some of the methods of the class can throw an exception. The script I'm running contains an outer loop that catches the exception, logs an error, and creates a new class instance that tries to reconnect to the server. Problem is that the server only handles one connection at a time (...

c# class-wide exception handling

Is it possible to catch exceptions in a single place in a c# class file? I'm coding some unit tests in NUnit to test for a WCF Web-Service, and on all methods/tests want to trap a "EndpointNotFoundException" without having to code this for each test. edit I guess i wanted to create a descriptive error in this case without having to pu...

Why IllegalArgumentException (JDK 1.4.2) cannot be constructed with a throwable cause ?

From a class extending java.beans.PropertyEditorSupport : /** * Sets the property value by parsing a given String. May raise * java.lang.IllegalArgumentException if either the String is * badly formatted or if this kind of property can't be expressed * as text. * * @param text The string to be parsed. */ public void setAsText(...

Error message vs. throwing exception C# ASP.Net

In many cases in web applications you would need to return an error message, rather than simple true/false result. One would use exceptions for that, but I consider exceptions to be an indication of, you know, exceptional behavior. Let's take a Register() function for a class User for instance. If it was successful we can simply return t...

Unexpected value in Exception object in catch block (c# compact framework)

Hi, I maintain a c# compact framework application and have had 2 cases in 2 days where the a caught exception had a unexpected string in the Message. Both times due to a different exception type being thrown. In the following code the socket exception is caught, but the message shown relates to something else. //method1 try { ...

what this error means? [Erlang, mochiweb, MySQL]

Hi there, I made a comet chat server with Erlang and Mochiweb. And I run the "./start-dev.sh" to start the server. But after about 1 month I got the following error: =ERROR REPORT==== 26-Sep-2009::09:21:06 === {mochiweb_socket_server,235, {child_error, {badmatch, {error, [70,97,105,108,101,100,32...

Why are so many errors "AccessViolationException"s?

I have seen many errors over the course of my computer-using life, and a lot of them seemed to be Access Violation Exceptions calling way out into non-readable memory or 0x00000000/0xFFFFFFFF. What sort of programming error causes this? is it intentional to get the program to crash when something goes very wrong? ...

What is the difference between throw and throw with arg of caught exception?

Imagine two similar pieces of code: try { [...] } catch (myErr &err) { err.append("More info added to error..."); throw err; } and try { [...] } catch (myErr &err) { err.append("More info added to error..."); throw; } Are these effectively the same or do they differ in some subtle way? For example, does the first one c...

Should I force exceptions to test them ?

i have this method in my data access class and i have a unit test to make sure it does work properly, but my test doesn't test the exception so my question is should i create a new test to force the exception to be raised or should i just trust that the catch block will work just fine in case of an exception ? is it worth the effort ? h...