error-handling

ASP.Net MVC Error handling using Action Filters Attributes

I am trying to implement Error handling using Action Filters Attributes as per ScottGu's blog My code is as follows: [HandleError] [HandleError(ExceptionType = typeof(NullReferenceException), View = "CustomError")] public class ArticlesController : Controller { public object OhDearACrash() { throw new Exception("Oh Dear...

ASP.Net MVC Custom Error handling via Action Filter Attributes

I am trying to implement Custom Error handling via Action Filter Attributes. My code is as follows: [HandleError (Order = 2)] [HandleError (Order = 1, ExceptionType = typeof(NullReferenceException), View = "CustomError")] public class ArticlesController : Controller { public object OhDearACrash() { throw new Exception(...

Rails friendly error page in development.

In my config/environments/development.rb I have the following line: config.action_controller.consider_all_requests_local = true which means I should get all the ugly error stuff when in development environment. But for some reason my app has suddenly started giving me the pretty error page you're supposed to see on production. Is the...

Theory on error handling?

Most advice concerning error handling boils down to a handful of tips and tricks (see this post for example). These hints are helpful but I think they don't answer all questions. I feel that I should design my application according to a certain philosophy, a school of thought that provides a strong foundation to build upon. Is there such...

Preferred Method to Catch Specific OleDB Error

Ok - I have a situation in which I must execute a dynamically built stored procedure against tables that may, or may not be in the database. The data retrieved is then shunted to a VB.Net backed ASP based report page. By design, if the tables are not present in the database, the relevant data is automatically hidden on the report page....

Bug tracking methodology

I'm working on software for a company that doesn't ever file bug reports, the only complain, "so and so isn't working." Sometimes I can figure out what they're talking about, sometimes not. My pleas for screenshots and more details fall on deaf ears (once they did take a screenshot, then printed it out, scanned in it with their fax machi...

Using Exception Handling versus NSError in Cocoa Apps

Hey all. I've been reading up on Apple's suggestions for when/where/how to use NSError versus @try/@catch/@finally. Essentially, my impression is that Apple thinks it best to avoid the use of exception handling language constructs except as a mechanism for halting program execution in unexpected error situations (maybe someone could give...

Strange error with initWithContentsOfURL

I'm currently working on reading some XML from an external API. The following code works fine: NSError *error = nil; NSString *xmlString = [[NSString alloc] initWithContentsOfURL:url encoding:NSUTF8StringEncoding error:&error]; However, I wanted to add some error handling ("The server cannot be reached", "No Internet connection" etc...

What's a good approach to writing error handling?

I hate writing error condition code. I guess I don't have a good approach to doing it: Do you write all of your 'functional' code first then go back in and add error handling or vice versa? How stupid do you assume your users are? How granular do you make your exception throws? Does anyone have sage advice to pass on to make this ea...

how to catch devenv exception

Hello, How can I catch an error in devenv? If an error occures (the build fails..) I need to print it out. How can I do that? Thanks! ...

Abort MySQL script conditionally

Given: MySQL database. Sometimes db schema changes and updates are rolled out (in the form of sql script). In order to guarantee correct order of updates applied (no duplicate updates, no updates missing, etc) I plan to deploy the following solution: CREATE TABLE meta (name TEXT PRIMARY KEY, val TEXT); INSERT INTO meta VALUES ('version...

Null pattern in Python underused?

Every now and then I come across code like this: foo = Foo() ... if foo.bar is not None and foo.bar.baz == 42: shiny_happy(...) Which seems, well, unpythonic, to me. In Objective-C, you can send messages to nil and get nil as the answer. I've always thought that's quite handy. Of course it is possible to implement a Null pattern i...

SQL Server catch error from extended stored procedure

Hello I have an extended stored procedure that sends an error message. srv_sendmsg(pSrvProc, SRV_MSG_ERROR, errorNum, SRV_FATAL_SERVER, 1, NULL, 0, (DBUSMALLINT) __LINE__, buff, SRV_NULLTERM); I've set the severity to SVR_FATAL_SERVER just as a test to see if I can cause the message to throw an exc...

Can Grails exceptionHandler support the following Error Handling Flow

In my rails app that I am porting to grails whenever an unexpected error occurs I intercept the error automatically and display a form to the user informing them that an error has occured and asking them for further information. Meanwhile, as the form is rendered I write the stack trace and other information about who was logged in to a...

WCF - Error Handling

Hello there, I have my WCF Service hosted in Windows Service. The client application is a website project to which I added the Service reference. I was not using any error logging/tracing... but now I feel I should implement as it will help me not to make void guesses. Please guide me for the best practice so that I can quickly handle...

AJAX Error Handlers, in AIR, using jQuery

I am trying to develop an AIR app, and I use $.get in some cases to obtain necessary data from the server. However, any AJAX request made with jQuery won't trigger my error callbacks. I currently have something very simple (I kept it as simple as possible to make sure it wasn't any of my code that was causing the problem): $.ajaxSetup({...

How to add global exception handling to a add-in dll?

Here's my context: I am writing a WPF add-in for an application. This Application's main thread is unmanaged. I want to add a global exception handling system for this add-in to handle any unhandled exceptions. Here's what I've tried but not working: I cannot add a try-catch block to my Application.Run() code line. Because I am an ...

organizing technical and user-facing error messages in php

I'm having a little trouble organizing my error messages for two interacting classes. One object has states that are 'error-ish', where something went wrong, or happened unexpectedly, but the situation is still salvageable. I don't want to use exceptions, 1. because they only have a single string for the message, and 2. because I want to...

How to throttle Django error emails.

I use django error reporting via email. It is normally a very helpful feature, except that now we have 5 minutes of database downtime and I got 2000 emails. Is there any middleware that will help me throttle the number of emails django can send out per minute? ...

Asynchronous loading / error handling

Let's say that I have a bunch of objects (thumbnails in a matrix for example) and I need to load some data files for all of those over the network (HTTP). So each thumbnail has the thumbnail image itself and an xml file for instance. There's a number of things that can go wrong from IO errors to bad URLs to badly formatted XML and so on...