error-handling

Spring - Ingres RDBMS support in sql-error-codes.xml error code mapping file

I have a Java project connecting to an Ingres database and using the Spring Framework. This issue is related to the error codes list configuration. According to Spring Framework API: Class SQLErrorCodes: JavaBean for holding JDBC error codes for a particular database. Instances of this class are normally loaded through a bea...

Java library to map HTTP status code to description?

I'm in the situation where I'm writing custom error pages for a webapp (primarily to reduce information disclosure from the servlet container's default error pages). Since I need an error page for each error status code, I'm going to have to have a sensible response for each code. As far as I can tell, these error pages don't have to b...

Do I need to release an returned NSError object?

There are many Cocoa methods that require an NSError object as a parameter to a method, but are really a means of returning an error object to the calling method if errors exist. Is this returned object retained? That is, in the calling object code (the method to which the error is returned), does there need to be some code like: NSEr...

Possible to use customErrors=On, but only for non-IIS handled errors?

I toggled customErrors=On in web.config, set the defaultRedirect for my custom Error.aspx page. However, this is only to prevent application errors from spitting out code - I'd still like IIS to handle 404s etc. with its default handlers, since they work fine. Any way to specify in my ASP.NET app or IIS for IIS to take priority? I know...

Generating compile time errors for invalid data types in a template class?

I am using C++ to create a string class. I want the class to only accept the data types char and wchar_t and I want the compiler to catch any invalid data types during compile time using #error. I do not like using assert( ). How can I do this? ...

On error, attempt to include a file and re-execute the failed function

First of all, this question is purely theoretical. Fact is, whether it's possible or not, it would be terribly bad practice. Having said that, here's my question: PHP offers the possibility to define custom error handlers via the set_error_handler function. By parsing the error message, it's possible to find out what triggered the error...

Best Practices for Error Logging and/or reporting for iPhone

When I do web development, I use a custom made logger that catches fatal errors and appends a trace to a file and displays a message to the user. I can occasionally glance to see if the file changed, which means, some user encountered an error and I can dig in to see what they encountered. I'd like something similar on the iphone, wit...

Upload Validation for photos

I got a javascript code like this to validate the file extension for my users when they upload pics on my server.It should allow both .jpg and .jpeg photos however only .jpg files are accepted and it invalidates if the photo ends with .jpeg.Here's the code: function validate(x) { var extensions = new Array("jpg", "jpeg"); var p...

error handeling returns blank

I have the following snippet from my code: switch ($extention) { case "gif": $src = @imagecreatefromgif($uploadedfile); break; case "jpeg": $src = @imagecreatefromjpeg($uploadedfile); break; case "png": $src = @imagecreatefrompng($uploadedfile); break; default: $src = @imagecreatefromjpeg($uploadedfile); break; } if(!$src) die("...

Selenium RC: how to capture/handle error?

Hi, My test uses Selenium to loop through a CSV list of URLs via an HTTP proxy (working script below). As I watch the script run I can see about 10% of the calls produce "Proxy error: 502" ("Bad_Gateway"); however, the errors are not captured by my catch-all "except Exception" clause -- ie: instead of writing 'error' in the appropriate r...

Error handling in Dynamic JS loading

I am loading a JS file needed only for one part of my web page, only when the user navigates to that tab on the page. var scriptFile = document.createElement("script"); scriptFile.setAttribute("type", "text/javascript"); scriptFile.setAttribute("src", scriptURL); I am trying to come up with an error handling mechanism for this dynamic...

Disable errors in PHP

How to disable errors just for particular php function, and in the same time to know that the error occurred? For instance, I use a php function parse_url, to parse an array of urls, sometimes it returns an error, what I want to do is to parse next url once error occurs, and not to show it(error) on the screen. ...

Spring - Best approach to provide specific error messages in a validator from a DAO?

What is the best way to implement a validator in Spring that accesses a DAO object but needs to return different error messages based on the DAO error? Should the DAO method throw different exceptions that the validator turns into proper error messages? Should the DAO return an enumeration so the validator can handle each return type s...

Rails - Getting an error message from the model that is not a Validation error.

So I have a method in a reservation model called add_equip. This method does some checking to make sure the added piece of equipment is valid (not conflicting with another reservation). The checks work. If a added piece of equipment shouldn't be added it isn't, and if it should it is. The problem is I can't figure out how to send...

Webpage error details

do you know why do I get this error? on the browser? Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0) Timestamp: Sun, 8 Nov 2009 10:54:36 UTC ...

CodeIgniter: set_message for max_length[x]

How do you set an error message for max_length and min_length rules. For instance, if I set a rule max_length[6], I'd like the error message to display Max characters allowed: 5 ...

php foreach error handling in function

I have a function which performs a foreach loop on an array from a database. see foreach ($teamarray AS $key => $value){$teamgo .= $value[1]." ".$value[2]."<br/>"; Problem is, sometimes there may be no data set, which throws an error when the loop hits that field. How can i catch/suppress this error? function GetUnsubmitted($coach){...

AppDomain.GetData method not accessible?

I am developing a Silverlight 3 application and I would like to delegate all unexpected error handling in a single instance of a class I have named ErrorHandler. This class has one method named HandleApplicationException, plus a couple of other methods to handle more specialized errors. In my application I am using Unity for dependency ...

Error Handling in Xcode, iPhone SDK

In Visual Basic, there's a line of code you can use to handle errors in code "On Error Resume Next" Is there something similar in Objective-C? My problem is I have an "Add New Cell" add button that creates a new cell during runtime. However, the cells are re-orderable. When you try to re-order the "Add New Cell" cell, I get an index o...

ASP.NET MVC app custom error pages not displaying in shared hosting environment

I'm having an issue with custom errors on an ASP.NET MVC app I've deployed on Go Daddy. I've created an ErrorController and added the following code to Global.asax to catch unhandled exceptions, log them, and then transfer control to the ErrorController to display custom errors. This code is taken from here: protected void Applicati...