error-handling

Can I propagate struts2 ActionErrors between different action classes?

If I have an action where the result is a redirectAction to another action in a different class, is it possible to get validation errors to display in the resulting action? E.g. in the following example, if a user executes actionA (which has no views associated with it), and there are errors, is there any way to display those errors in t...

Execute a shell command from a shell script without stopping if error occurs

In a sort of try/catch form I want to execute a bash that doesn't stop if an error occurs. The specific bash is: #!/bin/sh invoke-rc.d tomcat stop rm -fr /var/webapps/ cp -R $WEBAPP /var/webapps/ invoke-rc.d tomcat start I want to exec "invoke-rc.d tomcat stop" and even if Tomcat is not running, continue to execute the other bash c...

Get Last Error from LogonUser function and return it as a String?

Hey Folks, I am just wondering how i can get the error causing LoginUser function to fail in my C++ program and return it as a String? JNIEXPORT jstring JNICALL Java_com_entrust_adminservices_urs_examples_authn_LdapAuthenticator2_takeInfo(JNIEnv *env, jobject obj, jstring domain, jstring id, jstring idca, jstring password) { const...

What is an effective way to track, identify and report every 'error message' raised by your application?

In case management and workflow systems this seems to come up a lot. The need to provide a comprehensive list of each business message in the 'system' and provide its possible cause(s) and corrective action(s). A vendor example is Oracle: All their errors have a naming convention (e.g. ORA-00237) and they have documented every possi...

Can a browser correct a "mangled url" automatically?

Hello, I faced a problem some time back on a particular website. It has given many hyperlinks on it to other sites. e.g. of one such URL is: http://http//example.com/a9noaa.asp It is clearly incorrect (http comes twice) URL so when one clicks on it there is a page error like "Address not found". But when one copies the link location...

REST - what error to throw when a partly-invalid request is sent.

Hey guys, I'm developing a REST api. To simplify my question, I have an API that allows people to create a new blogpost. Blogposts can live in categories, and categories are specified by a category id. If a user would supply a category-id that doesn't exist, which HTTP error code is the most appropriate? 404 for Not Found seems bad, s...

Which process is accessing the file that caused an IOException when I tried to delete it?

I have some code that has thrown the following exception: System.IO.IOException: The process cannot access the file 'MyFileName' because it is being used by another process. at System.IO.Directory.DeleteHelper(String fullPath, String userPath, Boolean recursive) at System.IO.Directory.Delete(String fullPath, String userPath, Boole...

Runtime error stacktrace or location in VB6

I maintain an old application written in VB6. In client's environment it raises runtime errors which I can't reproduce under debugger. Is there any way to get the stacktrace or location of error? I mean, without putting trace statements all over the code like here or adding error handlers for logging to every procedure like here. It se...

Why VBA goes to error handling code when there is no error?

I have writen some code in VBA (Excel) with error handling labels. It worked fine until I recently notice the error handling code gets executed everytime, not just when an error occurs. Does anybody know why this happens? Thanks. Here's a trivial test case where both msgboxes would pop up. Sub example() On Error GoTo err_handle ...

Best practice when returning something from a routine.

What’s the best practice when returning something from a routine? Should I return a status bit always or just on failure? For example: Return(0, “Failed because….”) on failure, Return(1, success_value, second_success_value) on success. Or Return(0, “Failed because….”) on failure, Return( success_value, second_success_value) on success...

What is the simplest way to display httpServletResponse.sendError(403, "My Message") status from JSTL

I have a servlet which does some error checking and if something is wrong I will typically do this: response.sendError(403, "My message") return; I don't want to throw an exception from the servlet - because I would like to conform with HTTP status codes. In the web.xml I have configured the following: <error-page> <er...

Sending custom HTTP error information to Flash, JavaScript, etc.

I'm developing a REST API at the moment, and one of the core features of this is that is uses a variety of HTTP status codes to return status/error information, some of which may be extended information (e.g. if an item is not found, some other similar items) which will be in the response body. This is fine until you get to 'crippled' c...

What all APIs are affected by {$IOCHECKS OFF}?

We have some ancient Delphi code (might have even originated as Turbo Pascal code) that uses {$I-}, aka {$IOCHECKS OFF}, which makes the code use IOResult instead of exceptions for disk I/O errors. I want to get rid of the {$I-} and bring this code forward into the 1990s, but to do that, I'd like to know what all is affected by {$IOCHE...

Useful values to add to error messages .NET

On my application wide error handling I'm returning the host name to see what computer it happened on, application version, windows version, exception with all inner exceptions, and the stack trace. What other information can you get while inside the MyApplication_UnhandledException method that would be useful for tracking down an error...

Handling an output error in Access

I'm generating a query and report through VBA. I have an option of asking the user if they want to output the report as a snapshot. I first ask them if they want to make a snap shot. If they say no, nothing happens. If they say yes, they get a prompt asking where they want to save it. Everything works great except if they say yes ...

What is a good way to pass useful state information to an exception in Java?

I noticed some confusion initially with my question. I'm not asking about how to configure a logger nor how to use a logger properly, but rather how to capture all of the information that would have been logged at a lower logging level than what the current logging level is in the exception message. I have been noticing two patterns in ...

Is it best to handle SQL Exceptions or rather use a customError page and the Application_Error method in Global.asax?

I am using ASP.Net 2.0. I found myself in an awkward situtation because I could not find the cause of an error. Up until now I have been using this idiom when it comes to accessing data. try { access data } catch (SqlException exception) { Response.redirect("error.aspx"); } finally { Dispose of connections, commands etc } Now I ...

Where can I see the list of functions that interact with errno?

In the book "The C Programming Language" it says: "Many of the functions in the library set status indicators when error or end of file occur. These indicators may be set and tested explicitly. In addition, the integer expression errno (declared in <errno.h>) may contain an error number that gives further information about the mo...

RoR, Jquery, Ajax form errors

Alright. I have a create form where people are able to create businesses which are then added to the database. Everything worked fine. Rails was throwing it's errors if things weren't filled out correctly and if they were, you;d be directed to another page that would show you the business you just created. Now with that, I have to be ab...

Unit testing for compiler errors

How do you test for wanted raised compiler errors in unit testing? Consider the code: class ErrorTest { OtherClass& read_write() { return other; } const OtherClass& read_only() const { return other; } private: OtherClass other; }; How can I test for read_only() assignment? It's really imp...