error-handling

Flex 3 global exception handling

I want to create some sort of global error handling in my Flex application. What is the best approach for this? ...

What are some "good" ways to use longjmp/setjmp for C error handling?

My apologies if this has been address/asked before. I have to use C for one project and I am thinking of using longjmp/setjmp for error handling as I think it will be much easier to handle error in one central place than return codes. I would appreciate if there is some leads on this. I am particularly concerned with resource cleanup ...

How do I stop controller execution after using redirect_to? (Using Rails)

I have a controller with multiple actions that take :year and :month as attributes from the URL. I have made a private method check_date to check the date is valid and check the date is not in the future. def check_date(year, month) if month < 1 || month > 12 || year < 2000 flash[:notice] = I18n.t 'archive.invalid_date' redire...

What's a good way for a c# dll to return error to the calling application?

Hi guys, i'm writing a dll which is a wrapper to a access database. and i'm pretty new to c# in general as my background is in web development LAMP with perl, i'm not sure what's a good way to return error to a calling app in case they pass the wrong parameters to my functions or what not. I have no idea as of now except to probably do ...

A better error handler code for debugging db related methods in C# ?!

Hi, all. I have the following region I keep snippetting after the try {} blocks. It's purpose is to provide debugging information whenever configured back to the database ... It does debug nicely ( not all it is supposed to debug , but enough to find exactly the error, BUT .. The code smells. Even I can get it. Do you have a better idea...

ASP.NET MVC Error Logging in Both Global.asax and Error.aspx

I'm creating an ASP.NET MVC application. I need to handle exceptions in two places. Global.asax.vb file: Public Class MvcApplication Inherits System.Web.HttpApplication ... Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs) LogException(HttpContext.Current.Server.GetLastError(), Request) End Su...

a problem during init in constructor -- what's next?

C# noob question... I'm taking a few arguments in a class constructor to initialize some private variables. What should I do when the data passed in is not what I expect (wrong string length, numbers out of expected range, nonexisting path, stuff like that..)? Throw an exception? Add "everything went ok" flag? how is it usually done? ...

Handling Soap timeouts in PHP

I'm working on a project where I am verifying information from a user with a SOAP web service. I currently am taking care of errors assuming that I'm receiving responses from the web service, but also need to handle the edge cases of a service timeout or unavailability. In the case of a timeout or service unavailability, I need to prete...

Error Logging: Source Error and Source File

When developing a .Net web application, if a run time error is generated, it shows some "extra" debug information that I can't find in the Exception class. It shows a "Source Error" section which shows a code excerpt with line numbers showing exactly where the error was generated and it shows the "Source File", the actual page that thre...

How do I close Word (or other app) if an error occurs in a VBScript?

I wrote a VBScript app to open Word and Excel documents and search and replace blocks of text and various sections, pulling the new text from a plain text file. I purposely avoided any error checking, primarily because I couldn't figure it out at the time (and the script ran reliably anyway). Now months later on my local machine, I am in...

Guard Clause and Exception handling for the same condition

I ran across the following snippet of code. Names have been changed to protect the innocent: public void RunProgram() { System.IO.FileInfo fInfo = new System.IO.FileInfo(Application.StartupPath + "Program.exe"); if (!fInfo.Exists) { System.Windows.Forms.MessageBox.Show("Program could not be found, please verify your insta...

PHP: exceptions vs errors?

Maybe I'm missing it somewhere in the PHP manual, but what exactly is the difference between an error and an exception? The only difference that I can see is that errors and exceptions are handled differently. But what causes an exception and what causes an error? ...

WCF- Error handling when streaming.

Hi, In order to support streaming i return Message with override to OnWriteBody... The problem is if an exception is thrown in the OnWriteBody (DB timeout or whichever) The ProvideFault in the IErrorHandler is not called and therefore i have no way to propagate the error to the client( via a filtering in the IErrorHandler). Is there a...

IIS throws 404 errors outside from my ASP.NET MVC application

I've replaced an old PHP web site with a new ASP.NET MVC web site. The old page addresses no longer work. I want each to 301 (Moved Permanently) redirect to specific new addresses. But, IIS 7 seems to intercept many such requests before they get to my application. I want to handle the error logging and redirections in the Applicatio...

Should I use delegation here?

I currently have two class hierarchies: one for handling errors and another for logging them. I am wondering 1) whether it is advantageous to delegate error handling to a class separate from the error handler and 2) whether what I have is a good design. Here is what I have: class ErrorHandler { public __construct(ErrorLogger $ErrorLo...

How to handle non-fatal error conditions

I'm not sure if this is a duplicate but if it is please feel free to close this. Background: I have a timer component for a game i'm writing that supports Stop and Pause methods. The non-critical error cases in question are doing things like calling Pause when in the timer is already paused, this is not fatal but it's not going to cause...

Quality standards in Error reporting?

It seems not good for me, reporting errors like 'General Error: '+...., Is there any quality standard in error reporting for developers to follow? ...

Prevent paste of html page from clipboard into text box in c# ASP

I have a simple web user input form using c#. Users copy what they thin is a screen shot of error conditions to submit as input to the form. The copy action actually captures the HTML of the error page. When this is pasted into my test box I get an error (A potentially dangerous Request.Form value was detected from the client (tbxComm...

How should a global exception handler work in a web application?

In a web application on the intranet of a global enterprise, what should it show? What are some best practices or things some of you have learned over the years? I'm thinking about putting a text field and submit button on the error page that allows the user to automatically submit a help ticket if they need to... It will definitely log...

Exception handling in Ajax Calls.

I have an application utilizing lots of AJAX requests (different actions are triggered via XHR requests). Some of those calls may result in exceptions. Each time I have to display an error message to the user. How can I organize error handling in this case? ...