exception

Logout exception flooding elmah

I am using ASP.NET membership, and in particular a copy of the membership code included in the MVC project. I am also using elmah to log exceptions. I am getting flooded with the following when people sign out. System.Web.HttpException: Server cannot set status after HTTP headers have been sent. Here is the stack trace sent System.We...

Java: does the EDT restart or not when an exception is thrown?

(the example code below is self-contained and runnable, you can try it, it won't crash your system :) Tom Hawtin commented on the question here: http://stackoverflow.com/questions/3018165 that: It's unlikely that the EDT would crash. Unchecked exceptions thrown in EDT dispatch are caught, dumped and the thread goes on. Can someone e...

Null check error message as "is null" or "was null"

When doing null checks in Java code, and you throw IllegalArgumentExceptions for null values, what kind of message template do you use? We tend to use something like this public User getUser(String username){ if (username == null){ throw new IllegalArgumentException("username is null"); } // ... } What is better : "i...

Throw exception when re-assigning a constant in Ruby?

I've long been aware that "constants" in Ruby (i.e., variable names that are capitalized) aren't really constant. Like other programming languages, a reference to an object is the only thing stored in the variable/constant. (Sidebar: Ruby does have the facility to "freeze" referenced objects from being modified, which as far as I know...

Catch a generic exception in Java?

We use JUnit 3 at work and there is no ExpectedException annotation. I wanted to add a utility to our code to wrap this: try { someCode(); fail("some error message"); } catch (SomeSpecificExceptionType ex) { } So I tried this: public static class ExpectedExceptionUtility { public static <T extends Exception> void check...

Updating entity fields in app engine development server

I recently tried updating a field in one of my entities on the app engine local dev server via the sdk console. It appeared to have updated just fine (a simple float). However, when I followed up with a query on the entity, I received an exception: "Items in the mSomeList list must all be Key instances". mSomeList is just another list ...

Can this line of code really throw an IndexOutOfRange exception?

I am getting an IndexOutOfRange exception on the following line of code: var searchLastCriteria = (SearchCriteria)Session.GetSafely(WebConstants.KeyNames.SEARCH_LAST_CRITERIA); I'll explain the above here: SearchCriteria is an Enum with only two values Session is the HttpSessionState GetSafely is an extension method that looks like ...

Throwing an AggregateException in my own code

How should I go about collecting exceptions and putting them into an AggregateException to re-throw? For my specific code, I have a loop and will have zero or more exceptions thrown from a part of the code. I was hoping to just add the new exceptions to the AggregateException as they arise, but the documentation sort of indicates that i...

Getting information about where c++ exceptions are thrown inside of catch block?

I've got a c++ app that wraps large parts of code in try blocks. When I catch exceptions I can return the user to a stable state, which is nice. But I'm not longer receiving crash dumps. I'd really like to figure out where in the code the exception is taking place, so I can log it and fix it. Being able to get a dump without haltin...

validate constructor arguments or method parameters with annotations, and let them throw an exception automatically

I am validating constructor and method arguments, as I want to the software, especially the model part of it, to fail fast. As a result, constructor code often looks like this public MyModelClass(String arg1, String arg2, OtherModelClass otherModelInstance) { if(arg1 == null) { throw new IllegalArgumentsException("arg1 must...

ActiveRecord Create (not !) Throwing Exception on Validation

So I'm using ActiveRecord model validations to validate a form in a RESTful application. I have a create action that does: @association = Association.new and the receiving end of the form creates a data hash of attributes from the form parameters to save to the database using: @association = user.associations.create(data) I want...

How to resolve issue of loading web application in OC4J (10.1.3.5) that err and says - can't find the class oracle.jbo.JboException?

How to resolve issue - while loading web application in OC4J (101.3.5) the application server can't find the class oracle.jbo.JboException? ...

UITableView with multiple sections : section with 1 row, deleting the row crashes the app

Hi, I have a tableView with multiple sections. When a sections contains only one row, and if I try to delete that row, my app crashes while executing this code : [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:YES]; I get this exception : *** Terminating app due to uncaught exception 'NSRangeE...

What happens if an exception is thrown during finalize()

What would happen if an exception is thrown during the execution of finalize()? Is the stack unwind like normally? Does it continue finalize() and ignore the exception? Does it stop finalize() and continue GC the object? Or something else? I'm not looking for guidelines of using finalize() there are plently of pages explaining that. ...

Are JPA / Hibernate Exceptions not translated?

I finished a battery of DAO integration tests using JPA/Hibernate and many of them expect exceptions to be thrown. However, I have noticed that Hibernate seems to ignore the nice heirarchy of exceptions provided by the JPA spec and instead always throws the generic PersistenceException that wraps their Hibernate specific exception. Am ...

How to simulate an unhandled exception in Java

Hi, I am creating some multi-threaded code, and I have created a JobDispatcher class that creates threads. I want this object to handle any unhandled exceptions in the worker threads, and so I am using Thread.setUncaughtExceptionHandler(this); Now, I would like to test this functionality - how can I generate an unhandled exception in...

Microsoft Workflow - "Event cannot be delivered"

I have strange problem. My application is using Windows Workflow Foundation. It is simple app that creates requests and then other presons accepts/denies these requests. Everything was working very fine until my client took application to other servers (app and db). From this time WF instances are created in DB but when app tries to fir...

JavaScript Exception/Error Handling Not Working

This might be a little hard to follow. I've got a function inside an object: f_openFRHandler: function(input) { console.debug('f_openFRHandler'); try{ //throw 'foo'; DragDrop.FileChanged(input); //foxyface.window.close(); } catch(e){ ...

CancellationException while using AsyncTask in Android?

Hi, I am using AsyncTask in my application and sometimes when I run the application I get the error as java.util.cancellationexception. Can someone let me know the reason of this error or the way this can be removed? import java.util.concurrent.ExecutionException; import com.babbleville.io.BabbleVilleSyncTask; import com.babbleville.i...

java.lang.ClassFormatError: Extra bytes at end of class file

I'm getting an odd error when I try and run this program. The class compiles fine into multiple .class files and I compiled it last week (before editing it) just fine. But now, I see this: Exception in thread "main" java.lang.ClassFormatError: Extra bytes at the end of class file blah/hooplah/fubar/nonsense/IndexId$Transaction From wh...