exception

About Constructors in Java

Are constructors allowed to throw exceptions? ...

Hibernate Groovy entities

Hi All! I'm have a groovy hibernate entity, named 'Depart' for example. Now when i'm try to get their property (for example Long id = somedepart.getIdDepart() ) i'm got an exception Cannot cast Depart to Depart_$$_javassist_5 Who make Depart_$$_javassist_5 - groovy or hibernate? Is there some workaround about this? ...

making python 2.6 exception backward compatible

I have the following python code: try: pr.update() except ConfigurationException as e: returnString=e.line+' '+e.errormsg This works under python 2.6, but the "as e" syntax fails under previous versions. How can I resolved this? Or in other words, how do I catch user-defined exceptions (and use their instance variables) ...

Unable to catch c++ exception using catch (...)

I have a third-party library that is sometimes throwing an exception. So I decided to wrap my code in a try/catch(...) so that I could log information about the exception occurring (no specific details, just that it happened.) But for some reason, the code still crashes. On client computers, it crashes hard and the code to log the e...

C++ Boost Code example of throwing an exception between threads

Can someone please show a simple, but complete example of how one could use Boost exception library to transfer exceptions between thread by modifying the code below? What I'm implementing is a simple multi-threaded Delegate pattern. class DelegeeThread { public: void operator()() { while(true) { // Do some work ...

Java exception not caught

Why are some methods in Java not caught by Catch(Exception ex). This is code is completely failing out with an unhandled exception. (Java Version 1.4). public static void main(String[] args) { try { //Code ... }catch (Exception ex) { System.err.println("Caught Exception"); ex.printStackTrace(); exitCode = app.FAILURE_E...

C++: Safe to use longjmp and setjmp?

Hi, Is it safe to use longjmp and setjmp in C++ on linux/gcc with regards to the following? Exception handling (I'm not implementing exception handling using longjmp/setjmp. I want to know what side effects longjmp/setjmp will have on standard exception handling) *this pointer Signals Smart pointers (boost's shared and intrusive point...

SelectedValue which is invalid because it does not exist in the list of items

I encounter this problem repeatedly, and haven't a clue what is causing it. I get an exception in the DataBind: "SelectedValue which is invalid because it does not exist in the list of items". Here are some important pieces of information: 1) I reload listOrgs periodically when the underlying data has changed. 2) The Organization.DTList...

Unable to catch std::invalid_argument

I've run into an issue catching a std::invalid_argument exception that I'm not able to trace. I'm using gcc 4.4.0 (windows), pthreads-win32 2.8.0 the GC2 dll. Basically, from two threads (main thread and a thread started using pthread_create), I try to create an instance of class A at roughly the same time. The constructor throws an st...

How to read cell data in excel and output to command prompt

Hi All, I'm a sys admin and I am trying to learn how to use powershell... I have never done any type of scripting or coding before and I have been teaching myself online by learning from the technet script centre and online forums. What I am trying to accomplish is to open an excel spreadsheet get information from it (usernames and pas...

How can I resolve exception: Error executing child request for ChartImg.axd

I'm using the Chart Controls for Mircosoft .NET Framerwork. Most of the time they work perfectly. However, if I leave a page for longer than 20-30 mins and then try to refresh the page, I get an error saying: Error executing child request for ChartImg.axd. Exception Details: System.Web.HttpException: Error executing child request ...

Whats' a good way to extend Error in JavaScript?

I want to throw some things in my JS code and I want them to be instanceof Error, but I also want to have them be something else. In Python, typically, one would subclass Exception. What's the appropriate thing to do in JS? ...

What do You Use C++ Exceptions For?

Probably exceptions is the most controversial C++ feature. Many teams including google do not use them. Of course the decision to use them or not depends on the context -- for example, in some games it might be ok to crash on out-of-memory, but not in a medical equipment control software. Apart from out-of-memory, some teams may use exce...

Exception vs. error-code vs. assert

I'm working on a library that generates reports of devices. The generate_report (const std::string& no) member function can fail due to various reasons: invalid report no. invalid state (the report_generator is a FSM) no device is active error during report generation Which error-handling mechanism is best for these errors? just re...

SoapUI Pro 3.0.1 SocketTimeOut Exception:ReadTimeout

I am using SOAP UI Pro and when accessing any of the exposed methods in the services it always gives me SocketTimeOut Exception:ReadTimeout Any idea??? ...

catching exceptions in asp.net markup

How does one go about catching exceptions from using controls in markup? For example, I have the following code <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="http://feeds.feedburner.com/" XPath="rss/channel/item [position()<=10]"></asp:XmlDataSource> If feed...

Mysterious WPF exception: 'PresentationFramework.Eren Vista'

All of the sudden I am getting this mysterious FileNotFoundException exception inside my WPF project. It occurs right in InitializeComponent of my Window constructor: Could not load file or assembly 'PresentationFramework.Eren Vista, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies...

How to deal with not knowing what exceptions can be raised by a library method in Ruby?

This is somewhat of a broad question, but it is one that I continue to come across when programming in Ruby. I am from a largely C and Java background, where when I use a library function or method, I look at the documentation and see what it returns on error (usually in C) or which exceptions it can throw (in Java). In Ruby, the situa...

How do I propagate C++ exceptions to Python in a SWIG wrapper library?

I'm writing a SWIG wrapper around a custom C++ library which defines its own C++ exception types. The library's exception types are richer and more specific than standard exceptions. (For example, one class represents parse errors and has a collection of line numbers.) How do I propagate those exceptions back to Python while preserving t...

Stacks in Java with exceptions

Question : b) A Stack is a last-in first-out (LIFO) data structure. Write a Java class Stacklnt that stores a stack of integers using an alray as its private data structure. A Stacklnt has: A maximum size, which is set when a Stacklnt object is created. An exception should be thrown if the size is outside the range 10 to . 1000 A met...