error-handling

Outputting the exception from a SQLException error

I have a .aspx page calling a .asmx page's web service. In that .net web service I attempt to open a database connection to SQLServer 2008. The connection is failing. I am not sure why. I am doing this in a try / catch and the catch does get hit when I debug. I'm not sure what I can output there though as I don't have access to the serve...

PHP : Custom error handler - handling parse & fatal errors

How can i handle parse & fatal errors using a custom error handler? ...

Redirecting errors nicely without so much copy/paste?

If I have a view that handles the management of friends, meaning there is a view to handle adding, removing, blocking, unblocking, and accepting/denying invitations to become friends. The problem I have run into is when I try to provide meaningful errors to users who end up at a url they shouldn't be at. For example if User1 and User2 a...

Should code prevent a logically invalid call even when no harm would be done?

This one has been puzzling my for some time now. Let's imagine a class which represents a resource, and in order to be able to use this resource one needs to first call the 'Open' method on it, or an InvalidOperationException will be thrown. Should my code also check whether someone tries to open an already open resource, or close an a...

How to handle multiple asynchronous errors on a single page?

This is not necessarily a Flex-specific question, but I'll use Flex in my example: Scenario: We have a fairly complex MVC Flex application that uses remoting and makes several asynchronous calls on a single page. Some of the calls are: GetUserOrders GetCurrentOrder GetUserDetails If there is a network or DB error, this will throw th...

Error-reporting framework for .net

Hello, is there an error-reporting-framework you would suggest for use in .net. I need possibilities like e-mail-reporting with fileappending to e-mail. The user should have the possibility to add information to the report and also should have the possibility to remove report-files, i.e. if they contains privacy-critical data. There als...

error/exception handling in oracle

i want to develop a procedure for following scenario. I have one source, one target and one error table. Target and Error tables have all fields that are present in source tables. But the data type of all fields for error table are varchar. Error table don't have integrity, foreign key and other constraints. Error table also have t...

window.onerror does not work

I have some tricky AJAX code on a form, and sometimes it will fail (don't ask why, I can't get around it). When this happens, I need to trap the error, reset a hidden field indicator, and submit the form naturally so that the user does not have an unpleasant experience. I planned on using window.onerror to do this, but it is never firi...

PHP Try and Catch for SQL Insert

I have a page on my website (high traffic) that does an insert on every page load. I am curious of the fastest and safest way to (catch an error) and continue if the system is not able to do the insert into MySQL. Should I use try/catch or die or something else. I want to make sure the insert happens but if for some reason it can't I ...

PHP: MySQL error hook?

I've been developing a web application with PHP and MySQL. The other day, I made some changes to the database and adapted one page to the new table layout but not another page. I didn't test well enough, so the site went online with the error still in the other page. It was a simple MySQL error, and once one of my co-workers spotted it, ...

is it possible to ignore a fatal error in PHP?

I understand the significance of the term 'fatal error', but I want to write a test class like this (disgustingly simplified): class tester { function execute() { if( @$this->tryit() === true ) return true; return false; } function tryit() { $doesntexist = new noobject(); return true; } } act...

Don't want to throw an exception, should I return a custom class that holds a bool and string array?

There are certain areas in your code that you don't want the program execution to stop, like say during a checkout at a ecomm store. I was thinking of creating a special 'return' type that looks like: public bool SpecialReturn { public bool IsSucess {get;set;} public List Messages {get;set;} } I could put an enum there to ret...

Error handling in multi-layer WinForm App

If I have a multi-layer Winform app with a Presentation, Business and Data Layer for example, and I encounter an error in either the Business Layer or Data Layer for which the only logical action is to log the error and inform the user that an error has occurred where should the logging take place? Should I put the the methods in the Bu...

Display 404 File Not Found View If Catch All Route Does Not Match

Hi All, I have a catch-all route setup in ASP.NET MVC, so I can capture /this-page, /that-page etc. When you hit a page the action is invoked, say Index(string page) and then page is tested against a value in the database to determine if the page can be found. If it can't be found, I want to display the view FileNotFound which is in ...

How to identify why android app crashed

When I are using Java we put System.out.println() for identifying errors, where it went wrong. A very naive method. With android, I cannot even use this method to isolate why the app crashed. With Rails we would read the log file. But as I am new to Java and android, I don't know which is the best practice. I believe there is a best ...

log errors with stack trace in javascript

I'm trying to log javascript errors on a productive site. So far it worked quite well with the following code included in the site: function catcherr(errorMessage, url, line) { var parameters = "msg=" + escape(errorMessage) + "&url=" + escape(url) + "&line=" + escape(line); new Image().src = "/error.gif?...

List of things to check to prevent VC++ applications from showing fatal error message boxes

Every now and then there's a strong need to write a program in such a way that it never (really never) shows an error message as a message box. For example it can be a program run inside a daily build - if it hangs with a message box the daily build hangs. Unfortunately VC++ runtime has a lot of ways to trigger message boxes when indica...

Do I have to display specific error message for each error in PHP script(these error messages are included in Javascript code).

I am developing a website using PHP. I use Javascript/jquery to control/regulate user input. Of course I need to validate user input against these rules in PHP script. However, do I have to display specific error messages once an error is detected in PHP script? I mean if the Javascript runs properly, the errors of input won't come out i...

Why is my custom error handler not called?

When my script starts, I have: error_reporting(E_ALL); ini_set('display_errors', TRUE); ini_set('display_startup_errors', TRUE); And then, I register my custom error handler with PHP: function handleError($code, $text, $file, $line) { echo "&%!!"; return true; } set_error_handler('handleError'); Next, there comes some code...

Iframe error handling in JSP

Hi All, I have a JSP page which includes an iframe , Iframe contains the image display part & some other part, The problme is whenevr the iframe encounters an error, it gets redirected to error page (Error page is defined for the JSP) but not the whole page, only the iframe conained part of the page displays an error, I want the whole p...