error-handling

Catching errors with both mod_cgi & mod_perl

Thanks to everyone in advance. I've been doing some research on error handling and I don't feel like I'm getting a solid understanding of what I should do. Preamble: My code is living in Apache and executed in the browser, my goals don't include command line execution. I'd like to have the behavior of CGI::Carp (fatalsToBrowser) with ...

.NET "Send error report to [me]"

If an exception propagates all the way up to the top of my application (which, of course, will never happen), I would like to offer the option of sending an error report to me before the program crashes. What I have in mind is wrapping everything in the Main function in a try-catch, and a little class that sends the stack trace and other...

Handling stack overflows in embedded systems

In embedded software, how do you handle a stack overflow in a generic way? I come across some processor which does protect in hardware way like recent AMD processors. There are some techniques on Wikipedia, but are those real practical approaches? Can anybody give a clear suggested approach which works in all case on today's 32-bit emb...

error handling with spring + servlet spec

I have a web-app (2.5 servlet spec) with a spring dispatcherservlet handling anything coming on /error/* and an error page configured to route that to /error/ something like this: <servlet> <servlet-name>errorServlet</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-star...

How can I find the location of a "List index out of bounds" error in Delphi

In Delphi 2009, my program now produces a "List index out of bounds" error. It generates a popup box: I'm using the "Debug" Build Configuration that has all the Runtime error checking turned on. But this does not capture the error before it happens. Is there any simple way to locate the source of this error in my program without havi...

CCR: Best practice for handling errors using causalities

Having a complex sequence of tasks, implementing error handling can quickly bloat the code when using try/catch blocks and stuff like Choice receivers on PortSet<ActualResult, Exception> for every little task. Thankfully the CCR seems to offer a mechanism to handle exceptions in a more general way for a graph of tasks: causalities. A ty...

how to handle+communicate low level errors to wpf gui?

Heya I have a WPF gui that has an instance of a class called Manager, which essentially manages certain communication and data functions. I have try/catch blocks in my Manager, but I would like to know the best practice to communicate this to the gui. For example, clicking a button generates an onClick event, and in that code I woul...

RoR Catch Exception on Application Level

For a specific role (group of users) I added the :readonly to every find on the active record def self.find(*args) if User.current_user.has_role? 'i_can_only_read' with_scope({:find => {:readonly => true}}) do result = super *args end end end Of course it raises now ActiveRecord::ReadOnlyRecord...

Custom ActionResults: "Not Found", "Exception Encountered" - good or bad?

Would it make sense to create the following custom ActionResults? Why or why not? NotFoundResult Currently, if an action method encounters a scenario where it needs to send a "not found" page to the user, I call this method, which is defined in my base controller class: protected ViewResult PageNotFound(string internalErrorMessage...

Handling errors and exceptions on the iPhone

I am developinga Core Data app for the iPhone, and I am new to the whole platform etc. My question is, how much should I look for and handle errors and exceptions, for example when opening up the persistent store. Looking at the "Locations" Core Data Tutorial for example (hope its OK to quote it here like this): (Se comments in the cod...

if wpf app is not responding, then auto restart

I have a WPF application that occasionally crashes, and say "not responding". Is there a way to detect if the program is not responding? And if so, restart the WPF application? This will be a temporary fix until the bugs are fixed. ...

ASP.NET 2.0 : Best Practice for writing Error Page

In asp.net 2.0 web site, what is the best way of writing Error page. I have seen following section at following location: Web.Config <customErrors mode="RemoteOnly" defaultRedirect="~/Pages/Common/DefaultRedirectErrorPage.aspx"> Global.asax void Application_Error(object sender, EventArgs e) { } I am not getting how to use ...

Best Practices for MVC, jQuery and Handling Errors

Does anyone have a elegant way of dealing with errors in ASP.Net MVC? I constantly run into issues when dealing with requests to controller actions where the Action can be used for both normal requests and AJAX requests. The problem I have is finding an elegant way of dealing with these issues. For example, how could I handle validation...

Why is Perl script asking for 'global declaration' when I declare something in for loop?

I am reading $digit from infile and want to print it to outfile. But the Perl script is giving an error saying 'Global symbol "$digit" requires explicit package name'. But, if I do declare it globally , $digit='', then the this value is printed to the outfile instead of the value extracted/read from infile. Any suggestions as to what sho...

How can I gracefully exit my application on an error?

Here's a question where my real world programming inexperience shines through. I have a function which makes a call to three other functions: Public Sub StartService() RunSearch() SaveMessages() DeleteMessages() End Sub within each of the methods RunSearch(), SaveMessages() and DeleteMessages() I am using Try Catch statem...

Codeigniter & PHP - forcing a 404?

In codeigniter, as you know, a page of the form: /class/function/ID, where class is the controller name, function is the method within the controller, and ID is the parameter to pass to that method. The typical usage would be (for a book site for example) to pass the book id to the function which would then query the database for approp...

Providing a more meaningful message when an error is raised in PL/SQL

Suppose I have a PL/SQL function that selects one value from a table. If the query returns no records, I wish for the NO_DATA_FOUND error to propagate (so that the calling code can catch it), but with a more meaningful error message when SQLERRM is called. Here is an example of what I am trying to accomplish: FUNCTION fetch_customer_id...

Error Handling in User Defined Functions

I want to write a non-CLR user-defined function in SQL Server 2005. This function takes an input string and returns an output string. If the input string is invalid, then I want to indicate an error to the caller. My first thought was to use RAISERROR to raise an exception. However, SQL Server does not allow this inside a UDF (though yo...

try and catch a warning

...

Error handling of stored procedure having known errors being called from vb.net

I have sql server2000 encypted stored procedure. I can not modify them. Typicaly all the procedures manipulate row by row different tables using cursors etc. When the stored procedure is executed at the Query Analyser screen, I see error being thrown in between but the procedures continues till all the records have been processed. This...