error-handling

Branching after a file system task in SSIS without failing the package

If a file system task such as a rename fails, for example if the file does not exist, then this is considered an error by SSIS. This means the whole package fails. I can get around it by using a script task, or setting the maximum errors for the package to more than one. The problem with setting maximum errors for the package to more tha...

JScript Arguments Collection - .Net Equivalent

When writing code in JScript, as I am wont to do as I have never been a fan of ASP.Net and Jscript is infinitely more elegant than VBScript, you can call upon the arguments collection. This is extremely useful to pass into error handlers as you can then output messages to development teams which tell them exactly what the state of the ap...

PHP Constant doesn't exist: Notice

Hi, I'd like to use constants as config variables within my PHP applications, only when an constant doesn't exist (for whatever reason) it throws me an notice but i'd like that to be a error (or exception) just like when i try to echo a not existing variable. Is that possible without using a seperate function for getting constant value...

What do I do with my exceptions in asp.net?

I'm working on an ASP.NET MVC application and just getting to error handling. Help me solve the issue of getting the error message back to the user. I have a controller: [AcceptVerbs(HttpVerbs.Get)] public ActionResult Show(string callNumber) { ServiceCallService sc = new ServiceCallService(); return View...

ASP.NET 404 (page not found) redirection with original parameters preserved

I'm replacing an old web application with a new one, with different structure. I can not change the virtual directory path for the new app, as I have users which have bookmarked different links to the old app. Lets say I have a user, who has this bookmark: http://server/webapp/oldpage.aspx?data=somedata My new app is going to reside ...

In Java, is the "finally" block guaranteed to be called (in the main method)?

I'm a Java rookie and I was wondering, if I have the following typical Java code public class MyApp { public static void main(String[] args) { try { // do stuff } catch { // handle errors } finally { // clean up connections etc. } } } does the JVM guarantee that the finally block will always be ru...

Get readable WSDL service method arguments error in ColdFusion

Hello, developing service invoking script that looks like: <cfinvoke webservice="#ServiceURL#" method="AddCustomer" returnvariable="ResponseData" argumentcollection="#stAguments#"> <cfinvokeargument name="api_key" value="#ServiceKey#" /> </cfinvoke> stAguments structure filled before this call, obviously. Imagine you've forgot to...

How do you do Error handling (especially SQL) in an ASP.NET project right

I have a another ASP.Net web project that I am working and I have approached error handling from different angles. I was just wondering if any seasoned and experienced developers out there had any recommendations. Bonus points for discussions on a nice logging framework for ASP.net:) ...

error clause for file_put_contents

I am using this line to obtain and save an image from a URL. file_put_contents("./images/".$pk.".jpg", file_get_contents($PIC_URL)) I am unsure what the best way to deal with an error is. At the moment it is failing because there is no permission, which will be remedied shortly, but I would like it to be able to deal with situations w...

[HandleError] attribute does not seem to act at all...

I am having problems using the [HandleError] attribute on my Controller Actions - it doesn't seem to work at all (i.e. it doesn't matter if the filter is there or not - I get the same results...). When an Exception is thrown, I get the standard red-toned Server Error in '/' Application error page instead of my custom view. I have found ...

Unhandled Exception in Flup

I am facing the dreaded "Unhandled Exception" raised by Flup. The sad part is its raised at the webserver (lighttpd+flup) level and not at the application level(Django). So no 500 email is raised about where the problem is. Our entire team struggled hard to cleanup the codebase, incase of any ambigous imports and someones of that sort,...

How to handle an error that throws an alert box and make it show an AJAX error message instead?

I'm using Django and django-voting in an app I'm making. If a user who is not authenticated tries to vote, an alert box is displayed telling them they are not authenicated. How can I catch this error and make it into a more elegant AJAX display so I can show it right on the page when it happens? ...

Handling exceptions vs. Preventing them from occuring in the first place - C#

I have a asp:BoundColumn with DateTime? data (i'll call it column X) in the asp:GridView. I loop through all the rows in the grid, and cast the .Text property to column X to DateTime (i need this to do some checking and change the cell background color if needed). I have 2 options: wrap the cast in try/catch ... handle FormatException...

WPF: How to handle errors with a BackgroundWorker

I am a bit of a newbie when it comes to windows client programming. I have a background worker that has a DoWork event and a RunCompleted event wired up. If an exception gets thrown in DoWork, I want to make changes to my UI, however, I cant because it is in a different thread. I can communicate the error to RunCompleted, but that doesn'...

Techniques for steming a possible flood of automatically generated e-mail when a website encounters errors.

For my current web development project I'm implementing a back end system that will flag errors and send an email to the administrator automatically with details about what occurred. Trapping the error and generating the email with appropriate error information is pretty straight forward; but a problem arises when one considers certain g...

wget errors breaks shell script - how to prevent that?

I have a huge file with lots of links to files of various types to download. Each line is one download command like: wget 'URL1' wget 'URL2' ... and there are thousands of those. Unfortunately some URLs look really ugly, like for example: http://www.cepa.org.gh/archives/research-working-papers/WTO4%20(1)-charles.doc It opens OK in a...

How do you handle errors in error handlers in VB6?

I frequently encounter this situation in my VB6 applications Private Sub DoSomething On Error Goto err1 Call ProcessLargeBatch1 Call ProcessLargeBatch2 '... more ...' Exit Sub err1: Call Cleanup 'Specific for DoSomething' Call HandleError 'General error handling: Logging, message box, ...' End Sub The Cleanup proced...

What is the best way to return an error from a TSQL Proc?

Here’s the scenario: You load a page, which renders based on the data in the database (call these the “assumptions”) Someone changes the assumptions You submit your page ERROR! The general pattern to solve this problem is this (right?): In your save proc, inside a begin and commit transaction, you validate your assumptions first. ...

How to design error reporting in PHP

How should I write error reporting modules in PHP? Say, I want to write a function in PHP: 'bool isDuplicateEmail($email)'. In that function, I want to check if the $email is already present in the database. It will return 'true', if exists. Else 'false'. Now, the query execution can also fail, In that time I want to report 'Internal Er...

How to catch exceptions in javascript?

I want to catch exceptions in javascript if an insertion query is not done. I have written the code below: var adoConn = new ActiveXObject("ADODB.Connection"); var adoRS = new ActiveXObject("ADODB.Recordset"); var rec = new ActiveXObject("ADODB.Record"); adoConn.Open="DRIVER={MySQL ODBC 3.51 Driver};SERVER=172.25.37.145;" + "DATABASE=c...