error-handling

jQuery bug repeating function on error

Updated Question: JQuery animation repeats over and over if it encounters an error. Having a return or return false doesn't stop the animation from repeating. What would be the best practice to fix this error? Thanks. <div id="label"> FADE OUT </div> <script type="text/javascript"> $(function() { $("#label") ...

C homework, ignore for now (I think I am going repost later with some code)

I am going to be making a program that reads in a line and gets up to 6 numbers. The program will eventually solve a a square matrix between 2x2 and 6x6. My question is what errors do I need to look for on the get_numb() function? I am thinking that the function will have to check character by character to make sure that the individ...

How to simulate an ODBC time-out error?

I am testing the error-handling of an Access-VBA controlled process: A script in an Access 'controller' DB starts. The script starts a macro in a 2nd Access file (the 'database'). The macro in the 'database' file runs a bunch of maketable queries. These queries pull from tables linked to an ODBC source (SQL-Server actually). When thi...

No error or warning when attempt to access property of non object (not assigned)

Can somebody explain to me why PHP does not report a warning or error when accessing a property of a empty object (var is not assigned)? For example: $oMyObject->test = 'hello world'; // $oMyObject is not assigned but no warning or error When i do this, it produces an error: $oMyObject->test(); // Error: Calling function on non-obje...

How to use boost::error_info correctly?

I'm trying to following the examples on this page: http://www.boost.org/doc/libs/1_40_0/libs/exception/doc/motivation.html The minute I try the following line: throw file_read_error() << errno_code(errno); I get an error: error C2440: '<function-style-cast>' : cannot convert from 'int' to 'errno_code' How do I get this to work?? ...

Error patterns in rails, raise "text evaluting to RuntimeError" or raise MyModule::CustomError?

Q: The title is perhaps too big of question and the answer probably is "it depends"? However, providing some practical cases/examples should help developers, like myself, recognize when to apply what. I'll start out with my particular situation. Would you or would you not use custom error classes? Why/why not? Other examples as the one...

What is best way to catch errors and exceptions in error.log file in Zend Application?

I want to implement errorlogger in my zend application. I have created logger which I am using for debugging but Can anybody tell me what is the best way to log errors so that they are more readable in file. I have seen Sugarcrm logger which logs error in proper format. Does anybody have created logger like this. So that I can save my ...

How can I check if `File::Path::remove_tree` failed?

I'm used to `... or die ".. failed... $!";. I was surprised to find that in order to know if File::Path::remove_tree failed or not I must do something like this: remove_tree( 'foo/bar', 'bar/rat', {error => \my $err} ); if (@$err) { die "error..." } Am I missing something? Is this really the way to go? A lot of unneeded code for me...

Catch REFERENCE constraint exception from SQL in C#

What will be proper way to catch exception which throw SQL server when I deleting data with Reference constraint from C# code. I want to show my users message like: "I can't delete the data because is used" , rather than of showing message like this: The DELETE statement conflicted with the REFERENCE constraint ... The conflict ccurr...

Haskell: Why do the Maybe and Either types behave differently when used as Monads?

I'm trying to get my head around error handling in Haskell. I've found the article "8 ways to report errors in Haskell" but I'm confused as to why Maybe and Either behave differently. For example: import Control.Monad.Error myDiv :: (Monad m) => Float -> Float -> m Float myDiv x 0 = fail "My divison by zero" myDiv x y = return (x / y)...

Tomcat ignores my custom error servlet/page

Hello experts, I have an issue which drives me crazy. Not sure it this is a bug in Tomcat or just my plain stupidity but here goes. I have a custom error servlet set up, something like this. The setup works and if I simulate exceptions or 404 errors etc the servlet runs, the error page is displayed corectly, the response code is either...

No error output after installing all LAMP components

Today I installed LAMP on my Ubuntu 10.04. I created separate VH file for my site. When I started playing with code I noticed, that there are no errors. Some times code didn't appear, but no error message. I got curious and started to search, what might cause such behaviour. After 2h of searching I still don't have answear. Can anyone h...

powershell error checking during file copy with recursion

I have a program that copies folders and files recursively. example: Copy-Item -path "$folderA" -destination "$folderB" -recurse Sometimes the files do not copy. Is there a way to "step inside the recursion" or a better way to do it, so I can enable some kind of error checking during the process rather than after wards. Possibly even...

Error signalling in ELMAH not working with ASP.NET MVC

My understanding is that raising an errorsignal should log my error or hit the custom HandleErrorWithELMAHAttribute class(taken from this example) ,But it does neither. I am using the HandleErrorWithElmah decorator for the controller in question.The error logging works when it comes to unhandled exceptions in the controller(I am explic...

Python, Timeout of Try, Except Statement after X number of seconds?

I've been searching on this but can't seem to find an exact answer (most get into more complicated things like multithreading, etc), I just want to do something like a Try, Except statement where if the process doesn't finish within X number of seconds it will throw an exception. EDIT: The reason for this is that I am using a website te...

404 error page for all url contexts

Hi there. I have a custom 404 error page in my java web app. (declared using web.xml) It is working in all the cases. But if the url pattern comes like for example : www.mysite.com/admin/cannotfind the custom error page doesnt locate the images and css java script files for 404 custom error page. But it get works for normal url like www...

Statement if InnerException is null then don't show

I need to show the InnerException message if there is one and if not then i need to show the Message of the primary exception Here's what i've got Dim err As System.Exception = Server.GetLastError If err.InnerException.Message = "" Then Dim ErrorDetails As String = err.Message Else Dim ErrorDetails As String = err.InnerException.Me...

Error Handling on root website with no application

I have a root website with no application. Then under that root site are four virtual directories with applications. Each of these applications has good error handling. The root website has none. I added a web.config with a simple customerrors="remoteonly" and a redirect to the default error page which is a simple .htm file on this r...

Centralized ASP.NET error handling: <customErrors> vs. Application_Error. Is it possible to use both?

Currently, we are doing error handling via Application_Error in global.asax.vb: Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs) OurLibrary.HandleError(Me) End Sub HandleError then logs the error into a database, displays an informative message to the user and returns the correct status code (404 or 500) dependi...

twisted: no exception trace if error from a callback

Consider the following code: df = defer.Deferred() def hah(_): raise ValueError("4") df.addCallback(hah) df.callback(hah) When it runs, that exception just gets eaten. Where did it go? How can I get it to be displayed? Doing defer.setDebugging(True) has no effect. I ask this because other times, I get a printout saying "Unhandled err...