exception

ObjectDisposedException when Multiple Forms Are Open

My C# Winform application encounters the situation where it cannot access a disposed object. The disposed object is a form (frmQuiz) that is opened from a button on the login form. The Situation: My application typically has two or three forms open at the same time. The Program.cs file runs form frmLoginBackground, which is just a s...

Example of "using exceptions to control flow"

Hi, What would a piece of code which "uses exceptions to control flow" look like? I've tried to find a direct C# example, but cannot. Why is it bad? Thanks ...

Actionscript collisions: solving exceptions and strange cases

I have created a collision class to detect collisions using pixels. In my class I've also developed some functions for determining the collsion angle. Based on this I created some examples: http://megaswf.com/serve/25437/ http://megaswf.com/serve/25436/ (Space to change gravity, right/left to give some speed to the ball.) As you will...

How to catch an "undefined index" E_NOTICE error in simpleTest ?

I would like to write a test using simpleTest that would fail if the method I'm testing results in a PHP E_NOTICE "undefined index : foo". I tried expectError() and expectException() without success. The simpleTest webpage indicate that simpleTest isn't able to catch compile time PHP errors, but E_NOTICE seems to be a run time error. I...

Does DataRow throw an InvalidCastException when I insert a value of a different type...?

I'm trying to catch an Exception when an invalid value gets stored into a DataRow. I'm reading the values from a text file so anything could be stored there. I was hoping to be able to catch an InvalidCastException from the following code... try { // Store the values into the Data Row DataRow row = dataset.Tables["Table"].NewRow()...

Nice application to track exceptions in Java?

Is there an application or something out there that will track a Tomcat application's exceptions? Basically, I want an easier way of viewing problem areas in my application without having to read a long log file. ...

java.lang.RuntimeException: ERROR: Failed to recover corrupt cache entry

I just had this error message from one of my users. (IE8, Java 1.6.20 ). It is from an applet which receives instructions from Javascript and executes certain processes on the client. RangeError java.lang.RuntimeException: ERROR: Failed to recover corrupt cache entry at com.sun.deploy.cache.CacheEntry.recover at com.sun.deploy.cache.Cac...

Problem catching exceptions

Hey hey! I'm making an iphone based app and I have issues catching exceptions. So far, I've never had problem with try catches but here... well :D Here is the code that doesn't catch any exception : - (void)updateView:(NSTimer*)t { NSMutableDictionary *requestResult = [[[NSMutableDictionary alloc] init] autorelease]; @try {...

Getting ClassNotFoundException in java after removing class file.

Hi, I removed some class file *.class from a java project. It aims to make the whole project folder clean. Since the project was compilable and running well, I suppose that it will run faster after I clear some *.class. However, I got exception java.lang.ClassNotFoundException: at java.net.URLClassLoader$1.run(URLClassLoader.java:...

Performasure and hibernate

I have some pojos, which are mapped to a tables in database. When I deploy my code into performance tuning environment, I receive bunch of org.hibernate.MappingException due to $performasure_j2eeInfo is added to them by PerformaSure tool. Is there a way, I can configure my hibernate context file, so this field mapping will ignore mapp...

XElement.Parse NotSuportedException

I get a NotSupportedException when I parse the following string with an XElement: <ref>S. L. Vartanyan*, V. E. Garutt† & A. V. Sher‡parallel, "Holocene dwarf mammoths from Wrangel Island in the Siberian Arctic", Nature 362, 337&nbsp;– 340 (25 March 1993) [http://www.nature.com/nature/journal/v362/n6418/abs/362337a0.html Nature.com]</ref...

WebClient.DownloadDataAsync SocketException crashing my app

I've got the following code to download a binary file from the web: WebClient client = new WebClient(); client.DownloadDataCompleted += new DownloadDataCompletedEventHandler(DownloadDataCompleted); client.DownloadDataAsync(uri); All works well until the connection is severed. If I disable my wireless, the app crashes out: System::Win...

Double quotes into asp.net mvc url

how to handle double quotes in asp.net mvc url? ...

Is IllegalStateException appropriate for an immutable object?

Would you throw an IllegalStateException if: A method is unable to do its job because of the value(s) of one or more fields Those fields are final and assigned only in the constructor? Textbook example: your class is an immutable Collection<BigInteger> and your method is supposed to return the maximum element, but this instance is em...

C++ custom exceptions

hello. I have run into broken compiler, which does not allow exceptions to inherit from std::exception (nvcc 3.0). so had to create workaround: struct exception { explicit exception(const char* message) { what_ = message; } virtual const char *what() const throw() { return what_; } operator std::exception() con...

How do I recover after problem in WPF OnRender

Just had an interesting problem, caused by the following sequence of events: Code called from a WPF OnRender override threw an exception (there's no mystery in this - it's a trivial bug in some viewmodel code) The exception was unhandled, so was picked-up by our DispatcherUnhandledException handler. The DispatchedUnhandledException han...

Why am I getting this simplejson exception?

Why does Django give me this exception [(7, u'Acura'), (18, u'Alfa Romeo'), ...] is not JSON serializable When I try data = VehicleMake.objects.filter(model__start_year__gte=request.GET.get('year',0)).values_list('id','name') return HttpResponse(simplejson.dumps(data, ensure_ascii=False), mimetype='application/json') ? It's just ...

WPF: mysterious exception "Could not find file 'D:\xxxx\bin\Debug\xxx.vshost.exe.config'."

I am new to WPF and .net. I have a WPF app which someone else had written earlier and AFAI remember it was working just fine some time back. But today i see this mysterious error when trying to build the app and run from debugger : Exception : "Could not find file 'D:\xxxx\bin\Debug\xxx.vshost.exe.config" I am able to run the generated ...

Converting Java to Objective-C: Exception Handling

I'm converting a Java library to Objective-C. The Java code uses exceptions flagrantly (to my Objective-C accustomed mind). When converting, should I be throwing Objective-C exceptions (only within the library; I'll catch them before they leave) or should I use NSError constructs. I'm familiar with the use-case for exceptions in regular...

Do these rules fully define when to throw exceptions?

If a method fails to do what it says it will do (e.g. if SendEmail fails to send an email), it should throw an exception. I blogged about this in-depth (optional read): Do your work, or throw an exception - example. It seems this idea is already a convention, even though I have not found it described elsewhere. "Exceptions are for ex...