error-handling

Use of ThreadDeath under Error

What is the purpose of ThreadDeath under Error which is under Throwable? ...

PHPUnit : Fatal error handling

Hi all, I use PHPUnit for unit tests, but when a fatal error is triggered, the script dies and I have no correct PHPUnit output. I'd like that the PHPUnit output stays correctly formated, because it is read by a plugin for Eclipse. Actually the fatal error stops PHPUnit and in Eclipse the plugin can't interpret anything (because the PH...

How to display a MessageBox when wrong input is given and reverting the old value of TextBox using MVVM in WPF

I have been using WPF and its built in validation controls for quiet sometime. I was going through an excellent article in codeproject whose link is given below http://www.codeproject.com/KB/WPF/wpfvalidation.aspx I am having a requirement from one of our clients which I have not been able to chieve using MVVM in WPF. The problem is as ...

Creating a new directory structure and moving files using APS.NET and C#

Can someone tell me what is going to happen in this code when an error is encountered? Ideally it should continue the foreach statement until it gets to the last record, but I suspect it's stopping in the middle of the operation because when I check the number of files moved it's off by 225. If it is in fact stopping because of an error,...

TypeLoadException hiding inner exception

Hi I'm using Compact Framework 3.5 / VS2008. I'm getting really odd behavior with TypeLoadException. The following code throws this error. The reason is a problem with the database connection. However for some unknown reason this inner exception is lost and is not contained in the TypeLoadException. try { settingsFromDb = Settings...

Drupal error reporting by e-mail

I'm looking for a solution that would mail me errors from /admin/reports/dblog site in Drupal 6. The best would be a daily summary. Is there any module or a trigger+action solution for that? ...

Flex 4 error handling - how to know which piece of code caused the error

Hi, this question is about how to create useful log information in a .swf that should be send to a serversided log. I have read http://stackoverflow.com/questions/101532/how-to-catch-all-exceptions-in-flex and was very happy about the new UncaughtErrorEvent. But it is not as useful I thought first: You can not get a stack-trace out of...

Using C#, how can I detect a broken link or tag?

Hi, I have a html file that it isn't syntactically correct, I'm parsing it with HTML Agility Pack (http://htmlagilitypack.codeplex.com). But if I have a link like <a href="http://google.com/!/!!!"&gt;Google&lt;/a&gt; it's a problem, is there a possible way to detect broken links so that when an error is found (no page is available o...

How do you handle validation severity in Silverlight 4?

With 4.0, Silverlight now supports INotifyDataErrorInfo but out of the box I can't seem to find anyway of specifying a severity (Error, Warning, Info) in order to be able to style the inputs differently (red, yellow, blue). How do you handle this? Is there anyway to tap into the mechanism that styles the inputs, or do you have to resort...

MVC HandleError vs customErrors tag

So if I understand [HandleError] correctly (see here) you have to add it to each Controller that you want to have errors handled on. It seems much easier to just add the path of your error page into the web.config customErrors tag: <customErrors mode="On" defaultRedirect="~/Error/Index" > </customErrors> In what situations would usi...

PHP: Custom error handler for PDO?

I am attempting to try to do something useful with PDO exceptions other than display them, but I cannot find for the life of me how to use an error handler (set_error_handler) or anything custom to deal with PDOs exceptions. Now I am using try..catch blocks of course the catch the exception, do I implement a custom error handler in the...

How can I gracefully handle JSF application failures?

If my JSF applications, I'll sometimes come across a bug that, for example, corrupts a user session bean somewhere and the user is stuck looking @ a bunch of java exception gobbly-gook on their screen. The only way they can fix this is to restart their browser. Instead, I would like the application to handle something like this gracefu...

How to check that a regular expression has matched a string completely, i.e. - the string did not contain any extra character?

I have two questions: 1) I have a regular expression ([A-Z][a-z]{0,2})(\d*) and I am using Python's re.finditer() to match appropriate strings. My problem is, that I want to match only strings that contain no extra characters, otherwise I want to raise an exception. I want to catch a following pattern: - capital letter, followed by 0,...

What non-NULL memory addresses are free to be used as error values in C?

I need to write my own memory allocation functions for the GMP library, since the default functions call abort() and leave no way I can think of to restore program flow after that occurs (I have calls to mpz_init all over the place, and how to handle the failure changes based upon what happened around that call). However, the documentati...

How should I handle errors inside or outside a Perl module?

I started learning how to make a module in perl with perltoot: package Person; use strict; my($NAME, $AGE, $PEERS) = ( 0 .. 2 ); sub new { my $self = []; $self->[$NAME] = undef; $self->[$AGE] = undef; $self->[$PEERS] = []; bless($self); return $self; } sub name { my $self = shift; if (@_) { $self...

How to raise a warning in Python without stopping (interrupting) the program?

Hi, I am dealing with a problem how to raise a Warning in Python without having to let the program crash / stop / interrupt. I use following simple function that only checks if the user passed to it a non-zero number. If the user passes a zero, the program should warn the user, but continue normally. It should work like the following co...

MySQL - Why query with 'IN' fails?

These queries return correct results: SHOW FULL COLUMNS FROM `users` SHOW FULL COLUMNS FROM `teachers` But this one generates an error SHOW FULL COLUMNS IN ('users', 'teachers') I have tried single quote, double quote, back-quote and no quote and all fail. What am I doing wrong? The error is this: #1064 - You have an error in yo...

Application_Error exceptions handling, redirection infinite loop and CSS loading problem.

Hello, I have error handling in Application_Error event of globals.asax file. Inside this event, I'm using Response.Redirect(~errorview.aspx) method, for redirection to site which is able to handle errors in user friendly way. Everything works fine, unless exception is rising in Application_Start event. When error occurs there, my ap...

ActionScript - Handling Security Error Events On Socket Extension

i've created a socket extension class. the pseudo code below tries to make a socket connection using the passed parameters. if there is an security error, such as the port number not being an acceptable port number, i want to handle the security error. however, i can't catch the security error. a popup window appears with a descripti...

How do I log an exception with a full call stack?

I want to use ELMAH to log an exception (without throwing it all the way up the call stack) and it log the entire call stack. Example code: protected void Page_Load(object sender, EventArgs e) { DoSomething(); } private void DoSomething() { try { TrySomething(); } catch (Exception ex) { LogE...