error-handling

Trap error or 'Resume Next'

I realise this is an older programming environment, but I have to clean up some VB6 code and I am finding that most of it uses: On Error Resume Next What is the general consensus about the use of On Error Resume Next? Surely, if there is an error, you would want the app to stop what it was doing, rollback any data changes, and info...

How to avoid crashing your web app during replacing a file?

Hi, Let's say you have a big web app with large visits, but you don't want your app to crash & you don't want people to see the php or mysql errors that happens during replacing files using FTP, How to avoid that? How to just execute the old version of file until the replacing is done? Thanks ...

How can I make properties in properties files mandatory in Spring?

I have an ApplicationContext.xml file with the following node: <context:property-placeholder location="classpath:hibernate.properties, classpath:pathConfiguration.properties" /> It specifies that both properties files will be used by my application. Inside pathConfiguration.properties, some paths are defined, such as: PATH_ERROR=/...

What is the suggested way to show exception messages on UI which were produced in Business Layer?

Hi, Is there a pattern OR 'a best practice' on creating user's friendly messages in the presentation layer by using exceptions which were thrown from the Business Layer? Actually in many cases I prefer to throw Application Exceptions and this is forcing me to catch them on UI (aspx.cs pages). And if the process is complex which may pro...

Porting Windows C++ to Standard (Linux) C++ - WSAGetLastError()

I am currently porting some Windows mobile C++ code to standard C++. So I am trying to find alternatives for windows specific functions. I have had very little luck in finding a standard C++ function that can help me replace the WSAGetLastError() windows specific function. WSAGetLastError() returns error numbers for errors that occur ...

How do I use try...catch to catch floating point errors?

I'm using c++ in visual studio express to generate random expression trees for use in a genetic algorithm type of program. Because they are random, the trees often generate: divide by zero, overflow, underflow as well as returning "inf" and other strings. I can write handlers for the strings, but the literature left me baffled about the...

How to find in which controller/action an error occurred?

I'm logging all errors occuring in my OnException method. How to find in which controller/action an error occurred? ...

Getting a parse error when trying to send email using Zend Mail? Why?

Hi guys for some weird reason I'm unable to send email using zend mail :( - I keep getting the following error: Parse error: syntax error, unexpected T_VARIABLE, expecting T_STRING in /home/fltdata/domains/fltdata.com/public_html/admin/g-app/includes/mailer.php on line 77 Below is my code: if($_POST): $fields = array('to', 'cc',...

Better way to Handle error

I recently migrated a VB6 app to VB.Net. Entire VB6 dependency are removed . And the code was working fine just for a single module mean to say like for WinApp it is working fine. Now my requirement has been changed, now the same class will be accessed by multiple application , it might a Windows App, Web App or a web service. So I am ...

Store #VALUE! #NUM! #REF! in variable.

So a simple version of what I'm trying to do. Say I know there is an error in cell(1,1), furthermore I know it is either #num!, #ref! or #value!, I want to be able to store the respective error message in a variable, so I can print it to a different sheet. This is what I tried and it clearly failed. Sub FindAndPrintErrors dim Store as...

Exception handling with simplexmlrpcserver - python.

Hello, Is there any way to handle connection errors with simplexmlrpcserver module? I want to catch any errors within my xmlrpc server to handle them in my own way instead of printing the traceback to stdout. ...

lua recursive repl on error?

In many scheme/lisp dialects, when an error occurs, a "recursive repl" is popped up ... one can execute scheme/lisp code at the frame where the error occured, and go up/down the stack. Is it possible to do something similar to this in lua? Thanks! ...

NerdDinner Visual Web Developer 2010 Settings

I'm following steps of the NerdDinner tutorial. In the dinner Model class where I have error and validation handling for CRUD instead of error notifications in browser I get some kind of debugger dialog. Why is that? ...

C# MessageBox Error Messages

Hello. In my application I am using message boxes to display error information. try { // Something... } catch (SystemException ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } This was fine at first, but as my program grows it becomes increasingly difficult to find the try-catch block wh...

Any good idioms for error handling in straight C programs?

Getting back in to some C work. Many of my functions look like this: int err = do_something(arg1, arg2, arg3, &result); With the intent the result gets populated by the function, and the return value is the status of the call. The darkside is you get something naive like this: int err = func1(...); if (!err) { err = func2(...);...

errorPage directive works, but error-page in web.xml doesn't?

I get jsp exceptions causing a forward to my error page when I put this at the top of my JSPs... <%@ page errorPage="/error.page" %> but when I try to do it globally with web.xml like so: <error-page> <exception-type>java.lang.Throwable</exception-type> <location>/error.page</location> </error-page> I just get a blank page...

Has form post behavior changed in modern browsers? (or How are double clicks handled by the browser)

Background: We are in the process of writing a registration/payment page, and our philosophy was to code all validation and error checking on the server side first, and then add client side validation as a second step (un-obstructive jQuery). We wanted to disable double clicks server side, so we wrote some locking, thread-safe code to h...

running code if try statements were successful in python

I was wondering if in python there was a simple way to run code if a try statement was successful that wasn't in the try statement itself. Is that what the else or finally commands do (I didn't understand their documentation)? I know I could use code like this: successful = False try: #code that might fail successful = True exce...

When is it appropriate to use error codes?

In languages that support exception objects (Java, C#), when is it appropriate to use error codes? Is the use of error codes ever appropriate in typical enterprise applications? Many well-known software systems employ error codes (and a corresponding error code reference). Some examples include operating systems (Windows), databases (Or...

How to process database writes asynchronously (maybe with a message queue) from Django?

After a user submitted data to my app, I'd like to write to the database asynchronously, possibly through a message queue. How do I set up such a system? Are there any pluggable Django apps that do such message queue-based database writes? Also how do i handle errors that happens during the async processing? Would really appreciate an...