exception

C++, LHS state after exception is thrown

hi. I am learning C++ exceptions and I would like some clarification of the scenario: T function() throw(std::exception); ... T t = value; try { t = function(); } catch (...) {} if the exception is thrown, what is the state of variable t? unchanged or undefined? ...

No_data_found exception is propagating to outer block also?

In my code i am entering the salary which is not available in employees table and then again inserting duplicate employee_id in primary key column of employee table in exception block where i am handling no data found exception but i do not why No data found exception in the end also? OUTPUT coming: Enter some other sal ORA-01400: can...

Should the PHP community start using more descriptive Exceptions?

I work with Zend Framework a lot and I just took a peek at Kohana, and it strikes me as odd that this is a typical scenario in these frameworks: throw Some_Components_Exception( 'invalid argument' ); Where I believe this wouldn't be much more useful: throw Some_Components_InvalidArgumentException( 'whatever discription' ); Because ...

Android / Java rare and seemingly impossible exception causing force close

Hello all, I have an interesting problem being reported to me from an android application I have published. I have a two-dimensional array that I am iterating through using two for loops like so: for (int i = 0; i < arr.length; ++i) { for (int j = 0; j < arr[i].length; ++j) { if (arr[i][j] != 0) // does stuff...

Python Glade could not create GladeXML Object

Hey, I've created a simple window GUI in Glade 3.6.7 and I am trying to import it into Python. Every time I try to do so I get the following error: (queryrelevanceevaluation.py:8804): libglade-WARNING **: Expected <glade-interface>. Got <interface>. (queryrelevanceevaluation.py:8804): libglade-WARNING **: did not finish in PARSER_F...

Java: is Exception class thread-safe?

As I understand, Java's Exception class is certainly not immutable (methods like initCause and setStackTrace give some clues about that). So is it at least thread-safe? Suppose one of my classes has a field like this: private final Exception myException; Can I safely expose this field to multiple threads? I'm not willing to discuss co...

ObjectDisposedException when .Show()'ing a form that shouldn't be disposed.

ive checked out some of the other questions and obviously the best solution is to prevent the behavior that causes this issue in the first place, but the problem is very intermittent, and very un-reproduceable. I basically have a main form, with sub forms. The sub forms are shown from menus and/or buttons from the main form like so: p...

Throw exception from constructor initializer

What is the best way to throw exception from the constructor initializer? For example: class C { T0 t0; // can be either valid or invalid, but does not throw directly T1 t1; // heavy object, do not construct if t0 is invalid, by throwing before C(int n) : t0(n), // throw exception if t0(n) is not valid t1() {} }; I t...

How to change Exception message, "The application ... has stopped unexpectedly. Please try again later.”

Is there any way to modify the generic Android Exception message "The application ... has stopped unexpectedly. Please try again later.” to display something more meaningful to the user? ...

Visual Studio 2010 (Argument Exception)

Hi, I get the following exception: 'Cannot find the method on the object instance' when I hover over a property of one of my classes in Visual Studio 2010. Any ideas? ...

What are some different ways to handle warnings and errors in a programming language?

I'm interested in the different ways warnings and errors are (and could be) handled in programming languages. As far as I know, the only language-level error/warning functionality are the following: compiler errors/warnings (which can be created by programmers using compiler commands, usually compiler specific) console errors that can ...

How to properly test for constraint violation in hibernate?

I'm trying to test Hibernate mappings, specifically a unique constraint. My POJO is mapped as follows: <property name="name" type="string" unique="true" not-null="true" /> What I want to do is to test that I can't persist two entities with the same name: public class ExpertiseAreaDAOTest{ private ExpertiseAreaDAO ead; static ...

object not found error with dynamic web forms with (jquery) javscript script

In a normal aspx page I've set up a jquery tab system. When a particular tab shows up I wire up an ajax call to get another html page with the following content. It is simply a form with some javascript inside of it. <!-- demo.htm --> <form method="post" action="post.aspx"> <div id="fields"> Class: <input id="txtclass" name=...

java.net.UnknownHostException on file:// method

failed to open file file://D/:/dev/test_all.html JavaException: java.net.UnknownHostException: D Any ideas for why this happens? ...

Exiting from the Middle of an Expression Without Using Exceptions

Solved: I figured out a clean way to do it with setjmp()/longjmp(), requiring only a minimal wrapper like: int jump(jmp_buf j, int i) { longjmp(j, i); return 0; } This allows jump() to be used in conditional expressions. So now the code: if (A == 0) return; output << "Nonzero.\n"; Is correctly translated to: return ((A == 0) && ju...

Haskell: Dealing With Types And Exceptions

I'd like to know the "Haskell way" to catch and handle exceptions. As shown below, I understand the basic syntax, but I'm not sure how to deal with the type system in this situation. The below code attempts to return the value of the requested environment variable. Obviously if that variable isn't there I want to catch the exception and...

How and where do you define your own Exception hierarchy in Java?

How and where do you define your own Exception hierarchy in Java? My main question concerns package location where they your Exception classes must be defined. Do we create a special package ourexceptions and put all classes inside it? ...

Adding item to ListAdapter causes exception

I'm trying to use a list view, and when I add an item to the ArrayList of its ListAdapter and call notifyDataSetChanged, it throws an exception. Calling the addItem routine below will throw an exception. The message says Source not Found, and then this: // Compiled from DataSetObservable.java (version 1.5 : 49.0, super bit) // Signatur...

Can I automatically throw descriptive exceptions with parameter values and class feild information?

I honestly don't throw exceptions often. I catch them even less, ironically. I currently work in shop where we let them bubble up to avicode. For whatever reason, however, avicode isn't configured to capture some of the critical bits I need when these exceptions come bouncing back to my attention. Specifically, I'd like to see the pa...

PHP Exceptions in Classes

I'm writing a web application (PHP) for my friend and have decided to use my limited OOP training from Java. My question is what is the best way to note in my class/application that specific critical things failed without actually breaking my page. Currently my problem is I have an Object "SummerCamper" which takes a camper_id as it's ...