exception

Handle access violation exception in C++ Builder?

I'm trying to do: try{ int * i = NULL; *i = 3; }catch(Exception &Err){ ShowMessage(Err.Message); } I though that this should catch access violation exception and handle it by displaying an error message. But for some reason I get simple 'Access Violation' message instead of full one: 'Access Violation XXX in module YYY. W...

Exception handling in PHP: where does $e goes?

I been searching for this and I just seem to run into the same articles, in this code: try { //some code } catch(Exception $e){ throw $e; } Where does $e gets stored or how the webmaster see it? Should I look for a special function? ...

How to translate .NET Exceptions on WCF Services to English?

I am running Windows XP pt-BR (Portuguese - Brazil), a WCF service on a Windows Service container with HTTP Binding. I also wrote a test WCF client. And since I made a small modification on the service I am getting a MessageSecurityException. "An unsecured or incorrectly secured fault was received from the other party. See the inner Fau...

Toggle "Break when an exception is thrown." using macro or keyboard shortcut.

Note: The accepted solution doesn't quite work, but it's very close. Is there a macro or keyboard shortcut that will toggle "break when an exception is thrown" without using the GUI. Opening the dialog with ctrl+alt+e and checking the "Common Language Runtime Exceptions" "Thrown" box then clicking OK is simple enough, but this is som...

Why am I getting a NullPointerException in this for loop?

here is my code: Comic[] comix = new Comic[3]; comix[0] = new Comic("The Amazing Spider-man","A-1","Very Fine",9240.00F); comix[0].setPrice((Float)quality.get(comix[0].condition)); for(int i=0;i<comix.length;i++){ System.out.println("Title: " + comix[i].title); } Why am I getting a NullPointerException when this code run...

how and where to catch exceptions in a j2ee application

ok, im working in a j2ee project that has 2 branches in the repo and i'm ordered to mix them. i was coding and then netbeans ask me "unreported exception blah bla bla must be caugth or declared to be thrown" and gives me the choice of just handle each exception or just throw it hoping someone else catches. The classes i'm working with ...

SQLite Exception: SQLite Busy

Can anyone provide any input on this error. I am trying to insert into table using Objective C. While I am doing this, I am getting an error SQLite Busy. Why this is happening? ...

Getting Exception Details from ASP.NET PageMethods on the Client SIde

I am having a pagemethod to which i give a call from my JavaScript say Pagemethods.MyMethod(MyParameter, onsucess, onfailure); In the Code behind, I have something like this: [WebMethod] public static void MyMethod(Param) { try{ //DoSomething.. } catch(exception ex) { //Log the exception and rethrow thr...

VS 2008 Addon to temporarily disable/remove all catch block

Is there any addon by which I can disable all catch blocks temporarily. I'm maintaining an application and I need to find out where exactly it is throwing exception. Someone has done error handling is done is all layers to make my job tough :( ...

System.ExecutionEngineException Failure

I've been trying to find out more about this problem and I'm not having much luck. I keep reading that applications should not have this error come up and although that's all fine and dandy, it doesn't tell me what can cause this error to show up. I know this question is very broad as I'm sure there can be multiple causes for this error...

Access violation after catching dll exception

I have to load modules as dlls dynamically at runtime as they are not known ahead of time, just that they conform to a class interface. What I noticed is that after I catch an exception thrown by the dll (in the main program in the main thread), the right destructors are called and the modules destroyed and dll's unloaded, but then as t...

How can I find all empty try ... except blocks with GExperts grep?

In new versions of GExperts, the grep utility now supports more 'expert' expressions. I have not yet found a way to locate empty try ... except blocks in Delphi sources using regular expressions, how could I do this with the GExperts grep tool? ...

Exception swallowed when doing drag and drop

I have a WinForms application where I'm doing drag and drop between 2 TreeViews. At some point, I want to reject the action in the underlying business implementation, so I throw an Exception. I can see the Exception in the Output window but the problem is that I can't see it in the UI and it doesn't crashes. Where did the Exception g...

System.InvalidCastException: System.Data.DataViewManagerListItemTypeDescriptor

Am getting an exception randomly. I have a barcode scanner which enters barcodes into a table. The code is written in C#. I was able to get the exception twice at first; however, am no longer able to generate it. The exception is System.InvalidCastException: Unable to cast object of type 'System.Data.DataViewManagerListItemTypeDescriptor...

How to create exception helpers?

I'm looking at creating a helper method to set an exception's message, automatically setting String.Format, adding in inner exceptions, setting commandline exit codes, etc; something like: public static void MyExceptionHelper(ExitCode code, string message) {} public static void MyExceptionHelper(ExitCode code, Exception e) {} public sta...

ASP.Net MissingMethodException - "ctor" method not found

We are getting intermittent problems on a production server that we cannot recreate. There are two very strange things about the issue. Firstly it's a method not found error on the constructor (ctor) for an exception handling helper class and secondly we have custom errors switched on for remote users and this property is being ignored....

Pointer-to-Exception Clean-Up

We all know that throwing pointers to exception is bad: try { ... throw new MyExceptionClass(); } catch (MyExceptionClass* e) { ... } What's your approach to cleaning the catch targets up in legacy code? I figure that I can fix the first part by making operator new private: class MyExceptionClass { public: ... private...

Is it bad practice to return Exceptions from your methods

A lot of the code base methods my peers have written perform their own error handling, usually by catching, notifying, and logging. In these cases the methods return a boolean, indicating success or failure. Sometimes though, if a method fails, I want the calling code to know why, and returning a boolean is not enough. One way around ...

How to know when to use an existing Exception or write a custom Exception?

Thanks for the input on this question, I've decided to go with making my Create() method throw exceptions so as Jon Skeet said, you don't have to handle them everywhere and can just let them bubble up, seems the best approach for larger applications. So now I create instances of my classes with this code: try { SmartForms smartForm...

Java Exception handling within "events"

I would like to get a second opinion on how to handle Exceptions within "events" (key input, screen update etc). In this case I have control over the event-sender. So a module is set to handle an event (it implements a listener interface, and is registered against an event sender): public void DefaultSet ( CardData oldDefault, CardDat...