I am new to Java World.
We have Java applicaton where it gives a specfic type of exception is there any way we can have log4j to react to specific way. Having own appender for something like MQ connection exception we need to send email to specific group.
We are in the process of customizing a Java out of the application which intern...
What does "final" do in the following Java expression?
catch (final SomeExceptionType e)
...
I have the following code:
class Program
{
static void Main(string[] args)
{
string xml = @"<ArrayOfUserSetting>
<UserSetting>
<Value>Proposals</Value>
<Name>LastGroup</Name>
</UserSetting>
...
Possible Duplicates:
Java: Efficient Equivalent to Removing while Iterating a Collection
Removing items from a collection in java while iterating over it
I'm trying to loop through HashMap:
Map<String, Integer> group0 = new HashMap<String, Integer>();
... and extract every element in group0. This is my approach:
// itera...
http://docs.python.org/library/imaplib.html states that:
exception IMAP4.error
Exception raised on any errors. The reason for the exception is passed to the constructor as a string.
What does "exception is passed to the constructor as a string" mean? What would the code look like that can print the reason.
...
Does anybody know of a function to convert the EXCEPTION_POINTERS structure returned from GetExceptionInformation() into a string that I can log?
I don't want to roll my own if it's already been done.
EDIT: Basically, I've added the __try{} __except(){} blocks to help the app fail gracefully on a critical error. While I'm at it, I'm t...
While debugging my Visual Studio 2010 MVC2 solution, I noticed something that I didn't necessarily expect and that struck me as inefficient. When I was viewing the Home page, the IntelliTrace showed that many exceptions were getting thrown and caught while resolving a partial view.
I have code that calls the partial view like this:
<%...
If you have:
catch (FooException ex) {
throw new BarException (ex);
}
catch (BarException ex) {
System.out.println("hi");
}
...and the first catch clause is triggered (i.e. FooExcepetion has occurred),
does the new BarException get immediately caught by the subsequent "catch" clause?
Or is the new BarException thrown one leve...
I recently came across a code written by a fellow programmer in which he had a try catch statement inside a catch!
Please forgive my inability to paste the actual code, but what he did was something similar to this
try
{
//ABC Operation
}
catch (ArgumentException ae)
{
try
{
//XYZ Operation
}
catch (IndexOutOfRangeEx...
I have a C# application which calls a function in a C++ dll. This function can throw various exceptions which inherits std::exception. I currently catch these exceptions like this:
try
{
//Call to C++ dll
}
catch (System.Exception exception)
{
//Some error handling code
}
My first question is will this code catch all std::exce...
I'm writing a little developer tool which will (among other things) display exceptions thrown from the code that the tool is currently inspecting. Since it is a developer tool I would like to display as much information about the exception as possible (at the least type, message, stack trace and a recursive InnerException) and do it in a...
I have recently managed to get a stack overflow when destroying a tree by deleting its root 'Node', while the Node destructor is similar to this:
Node::~Node(){
for(int i=0;i<m_childCount;i++)
delete m_child[i];
}
A solution that come up into my mind was to use own stack. So deleting the tree this way:
std::stack< Node* >...
This question has been brought up many times, but I'd like to ask it again because I've read some things here that didn't seem right to me (could be because one is related to the .NET CF), and I am asking for validation of a specific approach that I think is reasonable, and would appreciate any feedback you might have.
Anyhow, the situa...
I am trying to invoke a web service from within a Java application deployed to JBoss 4.2.3. When I exercise the code that is invoking the web service from within Eclipse, I get no problems. When I exercise the code in a standalone application outside of JBoss, I get no problems. When I deploy that code though I get the exception below...
I have an unhandled exception handler. It shows a nice GUI and allows users to send an error report. Users can even leave their name and phone number and things, and our support department calls them back. Works well, looks good, makes customers less angry. In theory, anyway.
The problem is that my application uses background threads, a...
A long time ago I used to use "or die" in my PHP code. Especially like this:
$q = mysql_query('......') or die(mysql_error());
Obviously, that's pretty shameful these days, but the X or Y principle still speaks to me.
So I though I'd try this:
$r = $this->exec($query) or throw new Exception('FAIL');
but that results in a parse erro...
Im trying to draw a line .
I wrote a code like below.
UIColor *currentColor = [UIColor blackColor];
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetLineWidth(context, 2.0);
CGContextSetStrokeColorWithColor(context, currentColor.CGColor);
CGContextMoveToPoint(context, startingPoint.x, startingPoint.y);
CGContextAdd...
According to my application i create the database with two tables. when i inserting the data in 1 table then it runs correctly after that when i save data in the second table then it gives the exception of illegal state exception (database cannot be open). Please give me the solution.
...
I am following this great discussion at SO, titled: The case against checked exceptions , but I am unable to follow where exactly RuntimeException should be used and how it is different from normal Exceptions and its subclasses. Googling gave me a complex answer, that is, it should be used to deal with programming logic errors and should...
Hi,
I maintain an open source library that internally uses exceptions during a recursive method call. The exception is taken back on the call stack and in some cases handled, while in others it will be returned to the caller.
The problem we are having right now is that some users are running Visual Studio Debugger with the "Halt on ALL...