error-handling

VBScript -- Using error handling

Hi all, I want to use VBScript to catch errors and log them (ie on error "log something") then resume the next line of the script. For example, On Error Resume Next 'Do Step 1 'Do Step 2 'Do Step 3 When an error occurs on step 1, I want it to log that error (or perform other custom functions with it) then resume at step 2. Is this ...

C# Windows Service - Handle Exception on Startup

I'm writing a series of Windows services. I want them to fail if errors are thrown during startup (OnStart). I had assumed that merely throwing an error in OnStart would do this, but I'm finding that instead it "Starts" and presents me with a message stating "The service has started, but is inactive. Is this correct?" (Paraphrase). H...

How can I capture all exceptions from a wxPython application?

I'm writing a little debug app for a bit of kit we're developing and I'd like to roll it out to a few users to see if they can provoke any crashes. Does anyone know a way of effectively wrapping a wxPython app to catch any and all unhandled exceptions that would cause the app to crash? Ideally I'd want to capture all output (not just er...

Implementation of ISupportErrorInfo - what does it mean?

What does the ISupportErrorInfo interface mean? I'm at a bit of a loss to understand it. From MSDN: This interface ensures that error information can be propagated up the call chain correctly. Automation objects that use the error handling interfaces must implement ISupportErrorInfo. This method indicates whether or no...

Return 'null' or throw exception

I have a method that is suppose to return an object if it is found. If it is not found, should I: a) return null b) throw an exception c) other ...

Is there a way to determine whether an e-mail reaches its destination?

I have a PHP script that sends out critical e-mails that needs to reach its destination. I know how to check whether the e-mail sent successfully, the only issue is knowing whether it actually got to its recipient. Any suggestions? If there is no way of knowing, how would you handle this situation? ...

How to get proper line number when using trigger_error in PHP?

I am using trigger_error to "throw" errors in a custom class. My problem is that trigger_error prints out the line number where trigger_error was called. For example, given the following code: 01 <?php 02 class Test { 03 function doAction() { 04 $this->doSubAction(); 05 } 06 07 ...

Catching exceptions with tomcat and a servlet

I have set-up tomcat to catch all my exceptions and pass them to a servlet with the following in web.xml. <servlet-mapping> <servlet-name>exception</servlet-name> <url-pattern>/exception</url-pattern> </servlet-mapping> <error-page> <exception-type>java.lang.Exception</exception-type> <location>/exception</location> </er...

Custom error pages in Reporting Services 2008

I'd like to re-brand (and send error emails) for all of the SSRS default error pages (picture below) when you access reports via /ReportServer/. I'm already handling the ASP OnError event and some of the default SSRS errors appear to catch their own exceptions and then render this page cancel the response all before the OnError event is...

Proper use of try .. catch

Should I be using this method of throwing errors: if (isset($this->dbfields[$var])) { return $this->dbfields[$var]; } else { throw new FieldNotFoundException($var); } or this style: try { return $this->dbfields[$var]; } catch (Exception $e) { throw new FieldNotFoundException($var); } ...or something else altogether?...

Handle errors with ErrorController rather than a direct view.

I'm trying to get my head around the Error Handling in MVC. What I'm looking for is a centralized way to catch errors, log them, if possible resolve them, if nessecary take other actions and finally show the correct view to the user. I think I can use the [HandleError] filter for this, but I don't see any way to route it to a Controller...

How to really trap all errors with $etrap in Intersystems Caché?

Hello y'all I've been banging my head a lot because of this. In the way that $etrap (error handling special variable) was conceived you must be careful to really trap all errors. I've been partially successful in doing this. But I'm still missing something, because when run in user mode (application mode) there are internal Cache librar...

How do I handle exceptions thrown by asmx services?

ASP.NET ASMX service occasionally throws exceptions. However, global.asax Application_Error method do not seem to catch them. The question is, how to configure global error handler to catch and log these exceptions? ...

Error Log information in VB Script while processing

I am having an VBScript files which runs by many instance of jobs. I need to log the error information if any error occurs in the script processing. If i maintain a log file then how can i differentiate the log file for each instances (around 10 simultaneous instances) of vb script calling. I dont go for any db logging. Please suggest ...

JSP: How can I still get the code on my error page to run, even if I can't display it?

I've defined an error-page in my web.xml: <error-page> <exception-type>java.lang.Exception</exception-type> <location>/error.jsp</location> </error-page> In that error page, I have a custom tag that I created. The tag handler for this tag e-mails me the stacktrace of whatever error occurred. For the most part this works great....

Why global.asax Application_Error method does not catch exceptions thrown by ASMX service?

And how to fix it. I'd like to log every thrown exception for maintenance purpose. ...

Synchronizing a variable between client and server

Hello, Say I've got a client-side counter variable. When I send a request to the server, I send this variable's value, then increment it by one (for the next request to the server). The server keeps track of this counter independantly, and checks to make sure that the count sent by the client is 1 more than it's own (server-side) copy o...

Can awk skip files which do not exist, race-free?

Is there a way to make awk (gawk) ignore or skip missing files? That is, files passed on the command line that no longer exist in the file system (e.g. rapidly appearing/disappearing files under /proc/[1-9]*). By default, a missing file is a fatal error :-( I would like to be able to do the equivalent of something like this: BEGIN { M...

SQL Server 2005 - Error_Message() not showing full message

I have encapsulated a backup database command in a Try/Catch and it appears that the error message is being lost somewhere. For example: BACKUP DATABASE NonExistantDB TO DISK = 'C:\TEMP\NonExistantDB.bak' ..gives error: Could not locate entry in sysdatabases for database 'NonExistantDB'. No entry found with that name. Make sure that ...

WCF Error Logging at Service Boundary

I'm trying to implement an IErrorHandler in my WCF service in order to log every exception that hits the service boundary before it's passed to the client. I already use IErrorHandlers for translating Exceptions to typed FaultExceptions, which has been very useful. According to the MSDN for IErrorHandler.HandleError(), it's also intend...