error-handling

System.Web.HttpException in asp.net mvc 2 on images and javascript files

Hi I am getting the following errors reported by ELMAH on my asp.net mvc 2 site for javascript files, images etc. System.Web.HttpException: The remote host closed the connection I have done some research and it appears that the user/bot is clicking a link on the site before the page has fully loaded. Now this error never occurs o...

How to prevent users from typing incorrect inputs ?

Hello, This program asks for any row number. I want the program to loop a scan function if the user types anything else other than numbers.. My code is : do{ printf("Enter row number\n"); scanf("%d",&row); }while(row>='a' && row<='z'); but this code doesnt work .. I keep getting an error when typing in a letter. I tried man...

How to refactor VB6 code to prevent run-time errors

A VB6 app is experiencing a run-time errors at a variety of places. I know this is the result of poor error handling, but is it possible to analyse the code to see where it is susceptible to run-time errors? ...

Have I to count transactions before rollback one in catch block in T-SQL?

I have next block in the end of each my stored procedure for SQL Server 2008 BEGIN TRY BEGIN TRAN -- my code COMMIT END TRY BEGIN CATCH IF (@@trancount > 0) BEGIN ROLLBACK DECLARE @message NVARCHAR(MAX) DECLARE @state INT SELECT @message = ERROR_MESSAGE(), @state = ERROR_STATE() ...

Can't upload to google docs from php 400 error!

Hi guys I'm trying to upload to google docs on a google apps account using the following code - I'm using zend framework: function getGoogleClient($s = '') { $service = Zend_Gdata_Docs::AUTH_SERVICE_NAME; $user = 'aaaaa'; $pass = 'aaaaa'; $httpClient = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service); return $...

Implement Exception Handling in ASP.NET C# Project

hi, I have an application that has many tiers. as in, i have... Presentation Layer (PL) - > contains all the html My Codes Layer (CL) -> has all my code Entity Layer (EL) -> has all the container entities Business Logic Layer (BLL) -> has the necessary business logic Data Logic Layer (DLL) -> any logic against data Data Access Layer (DA...

Clearing Session in Global Application_Error

Whenever an unhandled exception occurs on our site, I want to: Send a notification email Clear the user's session Send the user to a error page ("Sorry, a problem occurred...") The first and last I've had working for a long time but the second is causing me some issues. My Global.asax.vb includes: Sub Application_Error(ByVal sender...

Convert an exception into HTTP 404 response in the Application_Error

Hi, First of all, quickly what exactly I want to achieve: translate particular exception into the HTTP 404 so the ASP.NET can handle it further. I am handling exceptions in the ASP.NET (MVC2) this way: protected void Application_Error(object sender, EventArgs e) { var err = Server.GetLastError(); if (err == null) ...

If a run-time error occus in a VB6 app, does this mean Error handling has been turned off?

If a run-time error occur in a VB6 app, does this mean Error handling has been turned off by use of the On Error Goto 0 statement? Can this assumption be made? Or are there other circumstances in which a run-time error could occur? If an error has been handled by either a Resume Next or a Goto then surely a run-time error would not oc...

SSIS Handling Extenal Issues

I have an SSIS package that works fine. The package runs every night and takes about 4 hours to complete. I have am a newb to SSIS, so I want to see what my options are. I am not finding anything on the web about these two issues, so any advice is greatly appreciated. What to do when I have an external issue such as a power failure/acc...

Call up last exception on an ASP.NET error page.

I've got an error page here SiteError.aspx and it's configured correctly in the web.config to go there when unhandled exceptions are encountered. I want to use this page to log the exception that triggered it as well because I only want to LOG the errors that the users encounter (i.e. if SiteError.aspx is ever hit.) This is the code I ...

Django: How do I use assert... without showing a system error page?

I'm new to Django and have some code in my views.py like this: try: myfunction() except: assert False, sys.exc_info()[0] This is very helpful because I get an email with lots of useful info if there's an error. The problem is that it also redirects the user to a Webfaction system error page. What I'd like to know is how do I s...

Suppress "Done, but with errors on page" in IE

I have a website using lots of jQuery and JavaScript that produces a "Done, but with errors on page" message in the footer of IE. Everything on the site works perfectly, so I don't want to spend the time troubleshooting the exact error. All I would like to do is suppress the "Done, but with errors on page" message so that clients don't ...

How to handle this "session failed to write file" error in PHP?

I am using the Kohana 3 framework, and am using the native session driver. For some reason, occasionally the sessions fail to write to their file. Warning: session_start() [function.session-start]: open(/tmp/sess_*****, O_RDWR) failed: Permission denied (13) in /home/site/public_html/system/classes/kohana/session/native.php on line 27...

Log client side errors to the server.

How can I log client side javascript errors to the server? I'm using jQuery and MVC. ...

Rails3 UJS example with unobtrusive dry flash error

Hi to everybody thislink text is a demo "done right" about rails3 and UJS, but if you add: validates :name, :presence => true to the Task model that error(500 Internal Server Error) is displayed nowhere. Do you know a correct and clean way to handle it? ...

How do I error handle the FTP functions in PHP.

When connecting to mysql, I have functions to get the relevant error message and error code, I see nothing of the sort in the list of ftp functions of PHP. Is there a best practice to handle errors in FTP? EDIT+CLARIFICATION: I think the best error messages are the system error messages + my own, is there a way to catch the system err...

Redirecting to frontpage after 404 error in PHP

I have a php web page that now uses custom error pages when a page is not found. The custom error pages are included in PHP. So when somebody types in an URL that does not exists I just include an error page, and the error page starts with: <?php header("HTTP/1.1 404 Not> Found"); ?> This also tells crawlers that the page does not ex...

What information do you capture when your software crashes in the field?

I am working on rewriting my unexpected error handling process, and I would like to ask the community: What information do you capture both automatic, and manually, when software you have written crashes? Right now, I capture a few items, some of which are: Automatic: Name of app that crashed Version of app that crashed Stack trace...

AST with fixed nodes instead of error nodes in antlr

I have an antlr generated Java parser that uses the C target and it works quite well. The problem is I also want it to parse erroneous code and produce a meaningful AST. If I feed it a minimal Java class with one import after which a semicolon is missing it produces two "Tree Error Node" objects where the "import" token and the tokens fo...