exception

jquery - Empty responseText in XMLHttpRequest object when server returns 500

I have to make SOAP calls from javascript between different domains. On the server side there is a list of allowed domains, methods and headers which are included in the response by a filter. It works well (even between different domains) when the response code is 200 but when an exception is thrown on the server side the xhr object has ...

Custom Exceptions: Differentiate via many subclasses or single class backed with enum?

I'm looking to implement my own set of Exceptions for a projects I am currently working on. The project relies on a core framework with a base framework exception MyFrameworkException (I am also writing this framework). For any given project I would like to throw several different types of Exceptions and I can't decide between using mul...

What does raise in Python raise?

Consider the following code: try: raise Exception("a") except: try: raise Exception("b") finally: raise This will raise Exception: a. I expected it to raise Exception: b (need I explain why?). Why does the final raise raise the original exception rather than (what I thought) was the last exception raised? ...

Strange Request URLs in logged ASP.NET exceptions, but not in IIS logs

Getting unhandled exception event log messages for legitimate exceptions but the event log message includes noise in the request URL. The noise is injected where uri escaped characters are. Noise like the apppool name, "An unhandled exception has occurred.", False and sometimes the request url itself recursively injected, sometimes a do...

Force close report error option- use in handled exceptions?

I find the force close Report option very useful as a developer- the stack trace is really useful to see and I've been able to solve many bugs by using it. However, there are places in my app where (quite rightly) I've used a try/catch statement to handle Exceptions. The problem being, that this prevents a force close and so I can't ge...

Android decoding json response

the request processing code while($op=db_fetch_object($result)) { $data[$i++]=array($op->name,$op->age,$op->dept); } echo json_encode($data); $data contains [["Aadidev","23","division1"],["Ragman","35","division3"],["Sahlaad","27","division1"],["Maraadhak","21","division2"],["Arya","48","division1"],["Shank","25","d...

Why is no_data_found ORA-01403 an exception in Oracle?

If the SELECT INTO statement doesn't return at least one row, ORA-01403 is thrown. For every other DBMS I know this is normal on a SELECT. Only Oracle treats a SELECT INTO like this. CREATE OR REPLACE PROCEDURE no_data_proc IS dummy dual.dummy%TYPE; BEGIN BEGIN SELECT dummy INTO dummy FROM dual WHERE d...

Readable C++\CLI Exception Message in C#?

the following code throws an exception in C++ and catch in C# C++ throw std::exception ("a C++ exception"); When i catch in C#, it gives me the following: [SEHException (0x80004005): External component has thrown an exception.] here is how i call the C++ code using Foo.Bar.Sample; //C++ library .... Class1 class1 = new Class1()...

Windows service for WCF Stops

Hi, I have a WCF application hosted as a windows service. This windows service triggers this WCF every 15 minutes. But when an exception occurs in this WCF the service is getting stopped. I don't want this service to stop. I want to some how handle this exception and trigger this WCF after another 15 minutes. How can i do that? Plea...

How to handle checked exceptions inside a functor object in Java

Hi all, We use the http://jedi.codehaus.org libraries for working with collections and manipulating them in a functional way. We recently came across a problem when doing something similar to the following: public class Address { //constructors and stuff public KiloWatts electricityConsumed(Duration timePeriod) throw NoElectri...

Why? "Always declare user defined exceptions as final"

I analyzed the code I am working on using a Java source code analyzer. One of the warnings is "Always declare user defined exceptions as final". There are many other warnings that doesn't make much sense but this one made me a little bit confused. I am working on a framework and I have one root generic exception (say FrameworkGenericEx...

JAVA: What do the return values mean for ArrayIndexOutOfBoundsException exceptions?

When my program throws the exception, i'm getting a return value of 7. What exactly does a 7 mean, and where can I get a list of these return values? Or is that just the first line where it happened (although i got a -1 one time)? Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 7 at DataReader.get(DataReader.ja...

Java 1.6 java.lang.IndexOutOfBoundsException Question

I seem to be getting an array out of bounds exception but the problem is the error message and my System.out and eclipse's debug tools tell me conflicting information. This is my exception: Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 9, Size: 9 at java.util.ArrayList.RangeCheck(ArrayList.jav...

How to see the error and still keep the program on in the Python shell?

I know try/except can handle errors in my program. But, is there a way of making the error be displayed in the program execution, be ignored and let the execution go on? ...

loss exception in block catch

I run this code: public class User { public static void main(String args[]) { int array[] = new int[10]; int i = 1; try { System.out.println("try: " + i++); System.out.println(array[10]); System.out.println("try"); } catch (Exception e) { System.out.pri...

What is the PHP equivalent to Python's Try: ... Except:...

I am a strong Python programmer, but not quite there when it comes to PHP. I need to try something, and if that doesn't work out, do something else. This is what it would look like in Python: try: print "stuf" except: print "something else" What would this be in PHP? ...

NUnit's TestCustomException doesn't care about the exception type

If I want to test that a method throws an exception of a particular type, NUnit's ExpectedException attribute doesn't care about the actual type; if I throw a generic Exception before the method call, the test passes: [Test, ExpectedException(typeof(TestCustomException))] public void FirstOnEmptyEnumerable() { throw ...

WinForms: there is no disk in the drive. please insert a disk into drive.

I have a WinForms application. It's written to disk. I run the application from disk and eject the disk from CD. Then I take the exception: there is no disk in the drive. please insert a disk into drive. How can I catch this exception and correctly close my application? ...

How to extract error info from Java log files (post-logging)

I'm trying to collect some advices on error logging in java. My log file is huge and going trough it is time consuming, currently I'm grep(ing) my log looking for error(ERROR) pattern, and then looking at line which threw exception then I search/find it and check out the error. Is there some better way of reading log files more efficien...

catching exceptions C#

What is right way to do. To catch exceptions from most specific to most general or opposite. if I write try { ... } catch( Exception e ) { ... } catch( NullReferenceException nre ) { ... } Will NullReferenceException nre ever be caught? ...