exception

Testing with Unittest Python

Hello, I am runninig test's with Python Unittest. I am running tests but I want to do negative testing and I would like to test if a function throw's an exception, it passes but if no exception is thrown the test fail's. The script I have is: try: result = self.client.service.GetStreamUri(self.stream, self.token) se...

JMS MessageCreator.createMessage() in Grails

Hi there, I am trying to implement jms to my grails application. I have several JMS consumer in a spring based enviroment listining on an ActiveMQ broker. I wrote a simple test commandline client which creates messages and receives them in an request response manner. Here is the snippet that sends a MapMessage in Spring JMS way. This...

Variable arguments and function overloading

I am trying to improve SQLite error handling in an existing C++ program. I have a custom type SQLiteException, and I want to write a macro to print the line number, file name, and error messages from SQL. I have the following functions defined: LogMessage(LPCTSTR message); // Does the real work. Appends a timestamp to the message and...

ensuring a well-defined object state when a constructor throws an exception

I have a Visual Studio 2008 C# .NET 2.0CF application. I'm using a component base from which two concrete components are derived. The application first attempts to use SomeDisposableComponent. Its constructor throws an exception because it requires a feature that isn't available. Then, the application tries SomeOtherDisposableComponent. ...

Exception in the OnIdle event does not bubble up

On my main form, I subscribed to two events: Application.ThreadException and Application.Idle. In theory, any exception that is not caught should get bubbled up to the main form. However, this does not work if the exception happens in the OnIdle event. The system just crashes. Does anyone know how to solve this problem? Thanks so much. ...

Is there a way in VS2008 (c#) to see all the possible exception types that can originate from a method call or even for an entire try-catch block?

Is there a way in VS2008 IDE for c# to see all the possible exception types that can possibly originate from a method call or even for an entire try-catch block? I know that intellisense or the object browser tells me this method can throw these types of exceptions but is there another way than using the object browser everytime? Somet...

Unhandled C# Exceptions

Can an unhandled exception in a C# application cause a blue screen of death? ...

Silverlight WCF method calls fails if WCF service is not running initially

Quite simply I have a generic Silverlight 3.0 web page that is calling a Ping method on a WCF service. I do not have the WCF service running initially when I navigate to this Silverlight page. As expected I get a communication exception when I press the Silverlight button to call the Ping method, which I catch. Now if I start the WCF ser...

how to read LDAP error codes

Hello I am having trouble reading ldap error codes. Is there any method or an API to read ldap error codes/sub error codes.Right now I am parsing the exception message and getting the error code. I believe there will be a simple way of extracting codes? Padur ...

Unsupported Type Exception in .net

Wondering what is the most appropiate Exception to throw when there is some case where I get an implementation of in interface that I dont expect Is there such a thing as UnsupportedTypeException in .net that I m not aware of? Cheers ...

Method chaining and exceptions in C#

If I have a method chain like the following: var abc = new ABC(); abc.method1() .method2() .methodThrowsException() .method3() ; assuming I've defined method1(), method2() and method3() as public ABC method1() { return this; } and methodThrowsException() as...

Why NullPointerException is a runtime exception and RemoteException not?

A possible reason because a NullPointerException is a runtime exception is because every method can throw it, so every method would need to have a "throws NullPointerException", and would be ugly. But this happens with RemoteException. And a possible reason because RemoteException is not a runtime exception, is to tell it client to trea...

Dynamic classloading fails on runtime

I have the following snippet of java code: final Class<?> junitCoreClass = AccessController.doPrivileged( new PrivilegedAction<URLClassLoader>() { @Override public URLClassLoader run() { return new URLClassLoader(new URL[] { junitJarUrl }); } }).loadClass("org.junit.runner.JUnitCore"); System.out.print...

Exception in ASAP.NET application - MARS TDS header contained errors.

We are getting an exception error about once week that causes the whole asp.net application to become not usable. Clicking on anything inside of the application throws the same error. The only way that the application can become usable again is to restart IIS. Has anyone had this error happen to them? Any insight on how to fix this er...

UnsupportedOperationException on Collection

While studying the Collection API, we find that some methods (add, remove,...) may throw a java.lang.UnsupportedOperationException if the current implementation of the Collection does not support those functionalities. Is there,actually, in the JDK, a concrete Collection that does not support those methods ? Thanks a lot for your answe...

Exceptions confusion

Hi there. I'm trying to build site using OOP in PHP. Everyone is talking about Singleton, hermetization, MVC, and using exceptions. So I've tried to do it like this: Class building whole site: class Core { public $is_core; public $theme; private $db; public $language; private $info; static private $instance; ...

Java Terminology: Why compile-time error and not compile-time exception?

This may sound awkward ... But I didn't understand it. Why do we have compile-time error and not compile-time exception in java ? I mean to say that we never say compile-time exception. We tend to say it as compile-time error. Is there any specific reason for the same ?? Any suggestions are welcomed.... Thanks ! ...

Question about the Cloneable interface and the exception that should be thrown

Hi, The Java documentation says: A class implements the Cloneable interface to indicate to the Object.clone() method that it is legal for that method to make a field-for-field copy of instances of that class. Invoking Object's clone method on an instance that does not implement the Cloneable interface results in ...

How to throw an exception in C?

I typed this into google but only found howtos in C++, how to do it in C? ...

How do i return a StringWriter When I cant Clone it?

My code looks like the below. Obviously i cant write 'ok' because the object has been disposed. I cant do return sw.Clone() bc clone doesnt exist. If i dont use a using then at any point between = new and return (like iterating and writing to the object as my example doesnt do) can have an exception and thus not disposing the object. Am...