error-handling

Handle URI hacking gracefully in ASP.NET

I've written an application that handles most exceptions gracefully, with the page's design intact and a pretty error message. My application catches them all in the Page_Error event and there adds the exception to HttpContext.Curent.Context.Items and then does a Server.Transfer to an Error.aspx page. I find this to be the only viable so...

How to handle exceptions during an ASP.NET request lifecycle

This question is kind of related to Handle URI hacking gracefully in ASP.NET in that it's too about how to best handle exceptions that occur during an ASP.NET request lifecycle. I've found a way to handle most exceptions gracefully, but then I've found that some exceptions occur so late in the request that there's no way to do stuff like...

.htaccess file opinion (howto)

I like to make a .htaccess file to redirect any errors I get from a web site. I have deleted all pages from the old site. But I have no idea what pages people have bookmaked. The new webpage and website structure is totally different ... so no page is the same as the old one, not event the index document that changed from index.html to...

jquery: ajaxError always fires last

I am building a page that may receive LARGE amounts of html from an ajax call, which it than insert into the page. Sometimes, instead of the html i am expecting, i will get an http 401 error. Ideally i want to have the error handler fire first, so i can set an error flag, display a message, and NOT insert the html that comes in. The p...

try-catch blocks with the return type

If I have a method that returns something, like public DataTable ReturnSomething() { try { //logic here return ds.Tables[0]; } catch (Exception e) { ErrorString=e.Message; } } This produces compiler error, obviously because catch{} block does not return anything. So when I have methods with return...

C# SQL Server Assembly Raise Error?

I have several assemblies for SQL Server 2005. If invalid data is entered to be run by my SP function (using C#), I want to pass back an error to sql server. For example, if someone enters something I don't want them to then I want to output something back to SQL Server prior to executing any query. Any ideas? ...

Why is there no assertError() function in FlexUnit?

It seems that most XUnit testing frameworks provide assertions for the times when you want to assert that a given operation will thrown an exception (or an Error in AS3 parlance.) Is there some "standard" way of doing this that I am overlooking, which would explain the absence of an assertError() assertion included with FlexUnit? I kno...

Disabling "The client disconnected." errors in ASP.NET?

We have a global error handler in our ASP.NET application that logs and emails any exception errors that may happen. One error that is common to ASP.NET is the "The client disconnected." error that happens when they close a page while data is still being loaded. The error itself is a non isue, however it gets logged and reported. I...

Are there an error handling API / framework in Java?

On a Server there can occur different temporary (transient) errors. For example an OutOfMemoryError or a broken connection to a database. I think it is a good idea to repeat such job a short time later. Of course it should not a endless loop because the error is not temporary. Are there any good API to help with it? Or a guide how I ca...

What is the best way to transfer error information from worker threads under CThreadPool?

I recently discovered ATL's CThreadPool class and was very happy with this find. It's a neat little class that will take care of the syncronization semantics of having multiple worker threads to process some queue of taks to do. The tasks are fed to the CThreadPool object, by some extrnal process. Now suppose one of the worker threads e...

How to properly handle error logs?

I tried to do several searches before posting this question. If this is a duplicate, please let me know and I will delete it. My question revolves around the proper way to handle errors produced through our web application. We currently log everything through log4j. If an error happens, it just says "An error has occurred. The IT Depart...

Handling Unhandled errors that happen in a secondary threaded process.

I have a asp.net 2.0 web app which calls a long running stored proc (about 3 minutes). The sp actually performs many tasks on the backend. My page uses threading and ajax (update panel) and a timer control to dispaly a progess bar to the user. This all works great unless there is an error in the sp which just freezes the screen. I ha...

SMTP through ASP.Net 2 Session Size Problem

We've been having a problem with a mass mailer component that I wrote for a long time and the exact nature of the difficulty, how to measure it and how to mitigate it have all remained elusive. It's got to the point where these problems are becoming critical and I need some straight answers so I'm hoping someone here can provide them. ...

Handling System.IO.IOException For Multiple Connections

I want to create an app to monitor the event logs of multiple servers remotely all is good however the servers are likely to be offline now and again. When i connect to a remote event log and the connection to the machine is lost a System.IO.IOException is thrown, I would like to hadle the error by connecting again to the remote server ...

"Failed to enable constraints" Error keeps cropping up (seemingly randomly) in my ASP.Net project

Hi, I have a weird problem where the "Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints." error sometimes pops up when I am trying to build my project. The line in question throwing the error was auto-generated code in the designer file for the dataset. To find out the ...

AJAX Error Handling Recommendations and Best Practices

I would like some recommendations on the best way to handle errors in AJAX-powered applications. Specifically, the methods used to log the errors and what do you do to address them. An obvious priority is that I don't want any user input lost. I was hoping to come up with some sort of fallback mechanism so that if an AJAX post fails, ...

How to rollback a transaction in TSQL when string data is truncated?

Currently I have a large import process that I'm trying to wrap inside a transaction so if anything breaks - i could rollback. The issue I have is that when the TSQL inside the trans blows up, it won't rollback when the following SQL error occurs Msg 8152, Level 16, State 14, Line 249 String or binary data would be truncated. The state...

C: pattern for returning asynchron error from background thread?

I'm writing an open source C library. This library is quite complex, and some operations can take a long time. I therefore created a background thread which manages the long-running tasks. My problem is that I have not yet found an elegant way to return errors from the background thread. Suppose the background thread reorganizes a file ...

How to direct to a custom error page?

In SharePoint, I want to be able to direct to a custom error page if a 404 is reached. However, after following: How to point to a custom 404 error Web page in Windows SharePoint Services 3.0 or in Microsoft Office SharePoint Server 2007 I'm unable to hit my custom error page when trying for entries such as: http://localhost/adsdasa...

Validating Class Data

In my app, I am creating a series of validation classes to check, for example, that a user entered Name property of the class (from a WinForm) doesn't exceed the size of the varchar() in the database. Currently, the validation code will throw a custom Exception if the Name field is too large. (The custom exception, when caught by the UI...