error-handling

Adding a Flash MovieClip to different parents, should have error?

On a project I spent an hour trying to fix a bug with MovieClips not appearing. The cause was that I was adding one MovieClip first to one parent and then to another. Flash allows this, but since display objects can only have on parent, it silently removes the MovieClip from the first parent. Not getting any error information, I didn't ...

Ruby Methods: how to return an usage string when insufficient arguments are given

Hi, After I have created a serious bunch of classes (with initialize methods), I am loading these into IRb to test each of them. I do so by creating simple instances and calling their methods to learn their behavior. However sometimes I don't remember exactly what order I was supposed to give the arguments when I call the .new method on...

Understanding try..catch in Javascript

I have this try and catch problem. I am trying to redirect to a different page. But sometimes it does and some times it doesnt. I think the problem is in try and catch . can someone help me understand this. Thanks var pg = new Object(); var da = document.all; var wo = window.opener; pg.changeHideReasonID = function(){ if(pg.hideReason...

How to see errors in an asp.net website?

I just want to see error insteas of asp.net showing me default error Server Error in '/' Application. What should i change in web config? I used this, <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm"> <error statusCode="403" redirect="NoAccess.htm" /> <error statusCode="404" redirect="FileN...

Does a rollback still occur if I use begin...rescue and an error occurs?

I've got some strange errors happening in my rails app and I'm trying to log better errors instead of the whole stack of passenger stuff that I don't care about. I thought I would do this with a Rescue clause and explicit error handling, like logging the params hash. But I'm concerned if this would interrupt any rollback that is happenin...

VBScript Catching Erroring Varialble Value

I have a VB Script (.vbs file) that is just a simple directory listing of a drive. It will the base of a drive back up script. But when running it as it is below, I am getting a Permission Denied error on some folder. What I need to find is what that folder is so I can figure out what the problem is with the folder. The line that is giv...

firefox window.onerror event problem - alerts "Script error!" only

I use the window.onerror to alert javascript errors for debugging. window.onerror = function(msg, url, line) { alert(msg + '\nLine: ' + line); }; When an error is fired, it can alert this actual error message in IE. But in firefox, it just alerts "Script error!", but I can still see the actual error message in firefox's error cons...

Try & Catch — How do you use them effectively?

I've been trying to teach myself JavaScript, and one thing I was reading on is the try/catch structure. Unfortunately, the tutorial doesn't provide much explanation on how it would be useful, just how to set it up. Can anyone offer some insight? ...

PHP error handling : my code is not optimized

Hello, I must warn you, this code will hurt your eyes, so please don't judge me, i'm trying to improve the way I handle errors all my tests are like this : if ($something < 27) { $error_IP= '<div class="error_message">something bad</div> '; }else{ $erreur_IP=''; } and here's the ugliest thing : if( !isset($_POST) || ($erreur_captc...

waht is equavalent to Server.GetLastError() in windows application?

Hi all, In asp.net web applications, it is possible to get all the errors by using application_error event in global.asax file and Server.GetLastError() method also. Is there anything available equivalent to the above in windows application. ...

Design Pattern for error handling in ASP.NET 3.5 site

I am relatively new to ASP.NET programming, and web programming in general. We have a site we recently ported from .NET 1.1 to 3.5. Currently we have two methods of error handling: either catching the error during data load on a page and displaying the formatted error in a label on the page, or redirecting to a generic error page. Both o...

how can I handle "error" in communication to twitter.com? (ruby + twitter gem)

I have nice piece of code that works. I tried to tweet the same text and I my script ended because /lib/ruby/gems/1.8/gems/twitter-0.9.4/lib/twitter.rb:87:in 'raise_errors': (403): Forbidden - Status is a duplicate. (Twitter::General) I know I cannot tweet the same text twice but I thought I will get the error inside the response variab...

PHP Postgres constraint violation - can I get the constraint name somehow?

We have a web application talking to a Postgres SQL database at work - I've set up many constraints on the server to keep data consistent but we have problems with reporting nicely what it is that prevents the user from entering his (invalid) data at a given moment. The only thing we can get is "Constraint violation" but that isn't very...

How should I display errors when a dynamic XML document is requested?

I'm currently writing a PHP script that 3rd party clients will be able to access using GET. It will take a few GET parameters and return an XML document with results. My question is, if required GET parameters are left out or contain invalid data how should display errors back to the end user? Should I return a completely different XML...

How do I catch an Exception where the interesting detail is in the Error Code?

My database connection routine can fail, for example, if incorrect credentials are supplied. In this case, a general OleDbException is thrown, with an ErrorCode of -2147217843. The message gives an error such as No error message available, result code: DB_SEC_E_AUTH_FAILED(0x80040E4D) How do I catch this? Using the error code -21472...

Ruby on Rails bizarre behavior with ActiveRecord error handling

Can anyone explain why this happens? mybox:$ ruby script/console Loading development environment (Rails 2.3.5) >> foo = Foo.new => #<Foo id: nil, customer_id: nil, created_at: nil, updated_at: nil> >> bar = Bar.new => #<Bar id: nil, bundle_id: nil, alias: nil, real: nil, active: true, list_type: 0, body_record_active: false, created_at:...

how can i make a good errror handler for my parsing which sends mail only when a page couldnot be opened???

Iam doing parsing and for that i need an error handler that should send mail only when a page is not opening up or is going on not found or is forbidden or something. What iam using currently is this :- function customError($errno, $errstr, $errFile, $errLine) { switch ($errno) { case E_ERROR:error_log("ERROR:in $errFile...

Is it ever OK to throw a java.lang.Error?

I have a plugin module that goes into a web application. If the module does not load correctly, it does not make sense for the web application to go on, and the web application should probably not load at all, we would prefer this module to initialize correctly always. If I were to throw a runtime exception, it would get into the logs, a...

Errors not being redirected to an Http handler if redirectMode="ResponseRewrite"

I see similar questions, but it looks like there were due to an unrelated issue. in 3.5, I have a custom error handler that logs errors and redirects users. My web.config is set up as such: <httpHandlers> <add path="error.ashx" type="MySite.Tools.WebErrorLogger, MySite.Tools" verb="*"/> </httpHandlers> <cus...

Error Controller with java servlets

How to make a ErrorController, like the ErrorController in the Zend Framework for PHP, with servlets in java? Now I have this <servlet> <display-name>ErrorController</display-name> <servlet-name>ErrorController</servlet-name> <servlet-class>project.controller.ErrorController</servlet-class> </servlet> <...