error-handling

Mac OSX/iPhone error handling in the App Delegate?

Hi all, I'm curious, how do most of you folks handle errors such as HTTP Forbidden or 5xx type requests from a server? Or say an exception is thrown in one of your UIViewControllers? Do you typically bubble up the error to the App Delegate and handle generic "window" level errors at that point? Do you couple errors directly into the UIV...

Steps to error proofing a mission critical process

I'm writing a program that will continuously process files placed into a hot folder. This program should have 100% uptime with no admin intervention. In other words it should not fail on "stupid" errors. i.e. Someone deletes the output directory it should simply recreate it and move on. What I'm thinking about doing is to code the ent...

iphone error dialog?

I wonder if is possible display a dialgo when a unexpected error happend in the iPhone (and not quit blindy the app!) and have time to log or send by email the crash... ...

C# Nested Try Catch statements or methods?

Simple best practice question. Should you nest try catch statements or just use methods. For instance, if you have a method that opens a file does work and closes the file, you would have the open and close outside the try catch, or rather the close in the finally block. Now if your open method fails, the method would assert right? So...

SQL Server Batch Error Handling Problem.

How do I get this batch of SQL to get to the RollBack Transaction part at the end? SQL just stops halts script execution on the bad line of code. I know I can use a try/catch construct but i'm more interested in how this was this handled before SQL added try/catch. BEGIN TRAN CREATE TABLE TempTable (c1 INT NULL) INSERT INTO TempTable ...

What is the correct usage of GetLastError and FormatMessage in Delphi ?

Hi, I have a problem using a third-party component in Delphi 2006 (also Delphi 7), in which I get an "Unspecified Error" when executing a function call to that component. Do you have example code that utilises GetLastError and FormatMessage in Delphi, that would allow me to access more information about the error ? TIA :) ...

Best way to display "input too long" errors with unicode input?

Does anyone have good suggestions for displaying "max length exceeded" errors to a user when a single character doesn't equal one byte? I'm at a loss for words, but I found a quote that's more eloquent: If the buffer runs over by three bytes, what do you tell the user? Three bytes could be one, two, or three characters that the user...

How to enable notices on my development server

I have a development version of PHP on Apache. I moved it to production and got this weird notices in my website. I don't have it on development version. How to enable these notices on my development version of website to fix them? ...

Binding application/json to POCO object in asp.net mvc, Serialization exception

I'm passing json back up from my view to my controller actions to perform operations. To convert the json being sent in, to a POCO I'm using this Action Filter: public class ObjectFilter : ActionFilterAttribute { public Type RootType { get; set; } public override void OnActionExecuting(ActionExecutingContext filterContext) { IList<Erro...

How do I run a custom function/bit of code when PHP has a parse error

I'm looking to run a bit of custom error handling for PHP's parse errors - the type when the syntax is wrong, and you get those white screens of death. (To be clear, the type that would result when running malformed code as so: <?php if () { ?> ) I had a look at setting a custom error handler, but couldn't get anything to happen. ...

How do I handle both caught and uncaught errors in a Perl subroutine?

This is a followup to "How can I get around a ‘die’ call in a Perl library I can’t modify?". I have a subroutine that calls a Library-Which-Crashes-Sometimes many times. Rather than couch each call within this subroutine with an eval{}, I just allow it to die, and use an eval{} on the level that calls my subroutine: my $status=eval{fun...

ELMAH SMTP

I am using ELMAH to email error messages. Is there an elegant solution to query a database for SMTP settings rather than use web.config? I would need it to be done before each error is thrown. The solution/s suggested here are a bit hacky for me. ...

Best practices for error handling in a web service

I'm now toying around with WebServices, using the .NET framework (.asmx files, not WCF). I'm wondering what's the best practice to tell the user that some sort of business-error has happened in the method call. My small test-case: I have measuring probes which need to register with a central server. Each probe should have a different p...

Best practices for defining your own exception classes?

I have some special exception cases that I want to throw and catch, so I want to define my own exception classes. What are the best practices for that? Should I inherit from std::exception or std::runtime_error? ...

Rail Validation Error Handling

Hello, Currently when my rails app encounters an error it dumps the error code and stack trace onto the browser window. How do I turn this off so that these error are only recorded in the log and not outputted to the browser? Thank you Correction: I am mostly concerned with only the validation errors. All I want is the same function...

ASP.Net, Capture image/screenshot of client error

Hi, We currently have fairly robust error handling functionality in our ASP.Net application. We log all errors in the database, a text file on the server and also send automated emails containing the error details back to our support people. This all happens on the server of course. We would like to capture (and retrieve) an image o...

handle ajax error when a user clicks refresh

i apologise if this is something i should be able to look up. all of the terms i wanted were way overloaded.. here is my problem: when i open a page, it fires off a whole series of ajax calls. if i then press Shift+Refresh, all of those ajax calls are being considered errors, and showing their error message dialogs before the entire pag...

Flow controlling macros with 'goto'

Yes, two hated constructs combined. Is it as bad as it sounds or can it be seen as a good way to control usage of goto and also provide a reasonable cleanup strategy? At work we had a discussion about whether or not to allow goto in our coding standard. In general nobody wanted to allow free usage of goto but some were positive about us...

NHibernate Error reporting advice

Hi, This is not so much a problem as advice on best practice really. I am writing an ASP.Net MVC application, and in my DAL i am using NHibernate, but what do you do if an exception is thrown in your DAL? Do you catch the exception in the DAL, log the error and then re-throw the exception? Do you not even attempt to catch exeptions at ...

What should be included in the state-of-the-art error and exception handling strategy?

I understand that this is a very broad question, but a short “it depends” kind of answer will not be accepted. Strategies are born to deal with broad issues. What issues should an application designer take into consideration when devising the error and exception handling strategy? How the strategy will differ depending on the software ...