error-handling

Identical Error Codes

I use python 2.4.1 on Linux, and a python package written inside the company I work in, for establishing a connection between 2 hosts for test purposes. Upon establishing the connection the side defined as the client side failed when calling socket.connect with the correct parameters (I checked) with the error code 111. After searching ...

Oracle: symbolic names and logical grouping for ORA-XXXXX codes?

So I'm going in and adding TAF (cluster failover) processing to some database code, and I'm winding up with similar chunks of code that look like this: try: ... some database code... except cx_Oracle.DatabaseError,e: # ORA-25401: can not continue fetches # ORA-25402: transaction must r...

Storing SqlServer's raiserror message in C#

How can I store SQLSERVER's raiserror message in C# ? Thanks in advance ...

Handling Silverlight onerror callback

The silverlight object tag accept an 'onerror' parameter which calls back to a piece og javascript of your choice. The default implementation the is generated by the Visual Studio template assembles a descriptive message and throw it as an Error (which lets e.g. IE display the little warning triangle). It seems to me that each time this...

Is there a way to see what the values of the arguments that are sent into a method in Java?

Hey, I am currently working on a debug/error handling tool for my Java project. This is a long-shot, but is there a way to print out the values of the arguments that are sent into a method? The JVM must have them stored when calling the method. Anyway I can just grab hold of those values? My goal is to just call on my own printArgumen...

Is it possible to reasonably workaround an antivirus scanning the working directory?

My Win32 application performs numerous disk operations in a designated temporary folder while functioning, and seriously redesigning it is out of the question. Some clients have antivirus software that scans the same temporary directory (it simply scans everything). We tried to talk them into disabling it - it doesn't work, so it's out ...

Is it bad practice to return Exceptions from your methods

A lot of the code base methods my peers have written perform their own error handling, usually by catching, notifying, and logging. In these cases the methods return a boolean, indicating success or failure. Sometimes though, if a method fails, I want the calling code to know why, and returning a boolean is not enough. One way around ...

Use C switch statement for error handling

Consider this C construct that checks for errors before doing actual work: int function(struct Context *context,struct Connection *conn) { int retval; switch(0) { case 0: retval = BUFFER_INACTIVE; if(conn->mSocket == -1) break; retval = BUFFER_FULL; /* Is there enough room to add ? */...

PHP - Converting all Errors to Exceptions - Good or Bad?

I was wondering if it's considered a bad practice to globally convert all PHP Errors to Exceptions. Something like the following would be used: function exception_error_handler($errno, $errstr, $errfile, $errline ) { throw new ErrorException($errstr, 0, $errno, $errfile, $errline); return false; } I suppose the assumption is ...

Which method do I better use, when I need error reporting display control ?

I want to manage error message display control, and I Googled for a while, and I found that there are several ways to do it. which method do I have to choose? The thing I want to do is that I don't want to PHP shows up any errors on users display, on Production Server. ...

How can I determine which exceptions can be thrown by a given method?

My question is really the same as this one "Finding out what exceptions a method might throw in C#". However, I would really like to know if anyone knows of a way to determine the stack of all the exceptions that may be thrown by a given method. I am hoping for a tool or utility that I can analyze code at compile time or through reflecti...

How does PPP or Ethernet recover from errors?

Looking at the data-link level standards, such as PPP general frame format or Ethernet, it's not clear what happens if the checksum is invalid. How does the protocol know where the next frame begins? Does it just scan for the next occurrence of "flag" (in the case of PPP)? If so, what happens if the packet payload just so happens to con...

Which HTTP Errors Should Be Custom Handled?

In my web site, I am currently custom handling two HTTP errors: 404 Not Found and 403 Forbidden. This "handling" consists of redirecting the user to a custom error page specific to the particular error. Are there any other HTTP (or, in fact, other kinds) errors that occur often enough to warrant a custom redirect and page? ...

Trouble getting ASP.NET MVC app to redirect to error page for unauthorized users

I've got the following set up in the web.config of my ASP.NET MVC application: <authentication mode="Windows" /> <authorization> <allow roles="MySecurityGroup"/> <deny users="*"/> </authorization> <customErrors mode="On" defaultRedirect="Error.aspx"> <error statusCode="401" redirect="Help.aspx"/> </customErrors> Everything...

How to deal with session timeouts in AJAX requests

I'm sure you're all familiar with the voting systems that use AJAX (Um... look right over there <----) I have something similar and when you vote up or down it uses AJAX to request the new value from votes.php. The problem is that I am using a session to get the userid so a person can only vote once. What happens if they sit on the page...

Eclipse Stacktrace System.err problem

All of a sudden my printStackTrace's stopped printing anything. When I give it a different output stream to print to it works (like e.printStackTrace(System.out)) but obviously I would like to get it figured out. ...

Catch error in GridView automatic databinding

I have a gridview with a DataSourceID set, so the databinding happens automatically. The problem is that sometimes, the procedure defined in the SqlDataSource takes a very long time to finish, so the binding comes with a timeout expired error. How can I catch this error without manually databinding the gridview and surrounding it with t...

What is the right way to do error handling in PowerShell?

PowerShell is a weird mix of .bat and .NET. In .bat, you check errorlevel and stderr output from commands. In .NET, you catch exceptions. How do cmdlets return errors? Do they throw exceptions when they fail or do they set $? instead? Is this configurable? I also assume that .NET functions I call in PowerShell will always throw excepti...

Validation errors not rendered in the view

I'm having a hard time figuring this validation problem. I have one parent domain class defined as follows: class Person { String fullName List telephones = [] static hasMany = [telephones : Telephone] static constraints = { fullName(size:3..50, blank:false, nullable:false) } } Then a sublcass: class Sal...

Tips on handling errors/exceptions in a web service.

Has any one got any advice or resources for best practices for handling errors and exceptions from within a webservice. ie. How much information needs to be reported back to the client? Should ALL errors bubble their way back as full blown exceptions? Is it common/advisable to wrap responses within a class which contains any error infor...