error-handling

How would you get the Sql Command objects for a Given TableAdaptor and SqlDataAdaptor in C# (.NET 2.0)

I am creating a generic error handling / logging class for our applications. The goal is to log the exception info, info about the class and function (as well as parameters) and if relevant, the information about the System.Data.SqlClient.SqlCommand object. I would like to be able to handle passing in SqlCommands, TableAdaptors, and Sql...

Exceptions: Is this a good practice?

This is written in PHP but it's really language agnostic. try { try { $issue = new DM_Issue($core->db->escape_string($_GET['issue'])); } catch(DM_Exception $e) { throw new Error_Page($tpl, ERR_NOT_FOUND, $e->getMessage()); } } catch(Error_Page $e) { die($e); } Is nested try, catch blocks a g...

What are the principles guiding your exception handling policy?

There is a lot of relativity involved in working with exceptions. Beyond low level APIs where exceptions cover errors raised from hardware and the OS there is a shady area where the programmer decides what constitutes an exception and what is a normal condition. How do you decide when to use exceptions? Do you have a consistent policy r...

What is the best way to collect/report unexpected errors in .NET Window Applications?

I am looking for a better solution than what we currently have to deal with unexpected production errors, without reinventing the wheel. A larger number of our products are WinForm and WPF applications that are installed at remote sites. Inevitably unexpected errors occur, from NullReferenceExceptions to 'General network errors'. Thus...

Never produce to an unknown pathway, in software too? [Toyota principle]

In Toyota manufacturing lines they always know what path a part have traveled. Just so they can be sure they can fix it of something goes wrong. Is this applicable in software too? All error messages should tell me exactly what path they traveled. Some do, the error messages with stack trace. Is this a correct interpretation? Could it b...

what is the better way to handle errors in VB6

I have VB6 application , I want to put some good error handling finction in it which can tell me what was the error and exact place when it happened , can anyone suggest the good way to do this ...

Error Message Text - Best Practices

We are changing some of the text for our old, badly written error messages. What are some resources for best practices on writing good error messages (specifically for Windows XP/Vista). ...

Best practice for translating exceptions in C++/CLI wrapper class

I am writing a .NET wrapper class for an existing native class which throws exceptions. What are the best practices for translating between native C++ exceptions and Managed exceptions? Catch and re-throw on a one-to-one basis (e.g. std::invalid_argument -> System.System.ArgumentException)? Is there a mapping already drawn up somewhere? ...

Logging JavaScript-Errors on Server

Hi Im running a ASP.NET Site where I have problems to find some JavaScript-Errors just with manual testing. Is there a possibility to catch all JavaScript-Errors on the Client Side and log them on the Server i.e. in the EventLog (via Webservice or something like that)? Thanks for your answers! ...

Can SQL Try-Catch blocks handle thrown CLR errors?

We are using SQL 2005 and the try-catch functionality to handle all of our error handling within the DB. We are currently working on deploying a .NET CLR function to make some WCF calls in the DB. This WCF procedure is written in the CLR and then deployed to SQL. If I put a try-catch block in the CLR code, it catches the error fine. Howe...

Retrieve Error text from SQL Server 2000 error

I need help logging errors from T-SQL in SQL Server 2000. We need to log errors that we trap, but are having trouble getting the same information we would have had sitting in front of SQL Server Management Studio. I can get a message without any argument substitution like this: SELECT MSG.description from master.dbo.sysmessages MSG IN...

Passing Exceptions to an error screen in ASP.net/C#

Coming from a desktop background I'm not sure exactly how to pass the exceptions I have caught to an Error page in order to avoid the standard exception screen being seen by my users. My general question is how do I pass the exception from page X to my Error page in ASP.net? ...

Error handling in PHP

I'm familiar with some of the basics, but what I would like to know more about is when and why error handling (including throwing exceptions) should be used in PHP, especially on a live site or web app. Is it something that can be overused and if so, what does overuse look like? Are there cases where it shouldn't be used? Also, what are ...

How do I interpret error codes from FrontPage Extensions?

Wrong answer was autoselected by the stupid bounty system. I'm using front page extensions to interact with SharePoint Services 3.0 as described here. In most samples I have seen the client simply looks for particular English strings in the result and uses that to determine if an error has occurred. However, I am writing an application...

What is the best approach to centralzing error messages in an application?

All throughout an application wherever error messages (or other user messages) are used I typically hard-code a string. Obviosly this can be really bad (especially when you may have to come back and localize an app). What is the best approach to centralize these strings? A static class? Constants? An XML File? Or a combination (like crea...

Catching exceptions within .aspx and .ascx pages

The questions says everything, take this example code: <ul id="css-id"> <li> <something:CustomControl ID="SomeThingElse" runat="server" /> <something:OtherCustomControl runat="server" /> </li> </ul> Now if an error gets thrown somewhere inside these controlls (that are located in a master page) they will take down the...

Good error handling practice

What is a good error handling practice for an asp.net site? Examples? Thanks! ...

How can I tell when .Net System.Diagnostics.Process ran sucessfully or failed?

I'm writing a scheduler or sorts. It's basically a table with a list of exes (like "C:\a.exe") and a console app that looks at the records in the table every minute or so and runs the tasks that haven't been run yet. I run the tasks like this: System.Diagnostics.Process p = new System.Diagnostics.Process(); p.StartInfo.UseShellExecute...

Enumerate errors in an error provider

Is it possible to enumerate all the current errors being displayed through an "Error Provider" without having to access the controls? ...

Best practice for handling ConnectionDroppedHandler in OCS Server Application

Hi all, In general, it seems that the majority of times that ConnectionDroppedHandler would get called in an OCS server application is for expected reasons e.g. server application has been unregistered, server is shutting down, etc. Are there any unexpected situations in which ConnectionDroppedHandler can be called? Basically, i'm wond...