Sometimes, you just have to catch Throwable, e.g. when writing a dispatcher queue that dispatches generic items and needs to recover from any errors (said dispatcher logs all caught exceptions, but silently, and then execution is continued on other items).
One best practice I can think of is to always rethrow the exception if it's Inter...
This issue has me baffled, it's affecting a single user (to my knowledge) and hasn't been reproduced by us...
The user is receiving a MissingMethodException, our trace file indicates it's occuring after we create a new instance of a component, when we're calling an Initialize/Setup method in preparation to have it do work (InitializeWo...
In C#, I can use the throw; statement to rethrow an exception while preserving the stack trace:
try
{
...
}
catch (Exception e)
{
if (e is FooException)
throw;
}
Is there something like this in Java (that doesn't lose the original stack trace)?
...
So I am a little confused, I have been looking around trying to determine an appropriate way of inheriting from std::exception for my own type. Now according to cplusplus.com (and i know this isn't necessarily the standard, thats why I'm asking), std::exception is a base class with no members. However, after looking at my implementation ...
See this question on how to break on any exceptions.
I'm getting a million exceptions on startup. I've tried ignoring ClassNotFoundException, but it's no good, the IDE still seems to break on these (and other) exceptions.
So .. what's a decent configuration for this to catch only real exceptions caught from user code? (Ignore also any ...
I am developing a DHTML/Javascript application which relies on some advanced features (DOM manipulation, AJAX, Flash communication, and more). I'm very concerned about functionality -- if problems occur, even after the application is deployed, I want to make sure I know why and how to fix them -- and also, I want to make sure the user is...
Hi,
The problem that I am facing is primarily on Exception Handling! When an exception occurs I want to put that data in another log table with the error message. However, in DB2 I am not able to figure out a way to retrieve the corresponding error message for the raised SQLSTATE.
PS: I have a stored procedure for this migration and I...
How do you do the equivalent of:
[Test, ExpectedException( typeof(ArgumentOutOfRangeException) )]
void Test_Something_That_Throws_Exception()
{
throw gcnew ArgumentOutOfRangeException("Some more detail");
}
...in C++ (the example there is C#)? As far as I can see, there's no typeof() function for the C++ implementation of NUnit.
...
I was going through the list of predefined Exceptions in PHP and I noticed the DomainException. Anyone know what does DomainException mean? Does it mean failed data model validation?
...
I'm just getting started with RAII in C++ and set up a little test case. Either my code is deeply confused, or RAII is not working! (I guess it is the former).
If I run:
#include <exception>
#include <iostream>
class A {
public:
A(int i) { i_ = i; std::cout << "A " << i_ << " constructed" << std::endl; }
~A() { std::cout << "A ...
I have defined a custom list template type for SharePoint. I install it using VSeWSS 1.3 and everything seems to behave correctly.
I have added a custom action which will add additional columns (SPFields) to the list. However, every time that code executes it throws and ArgumentException with a 'Value not in the expected range.' error m...
I am getting an exception thrown by the ASP.NET Development Web Server "Type is not resolved for member 'Model.AppIdentity,Model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'"
It works fine in IIS6.
Any ideas?
...
(Long time reader of SO, first time asking a q.
I'm quite new to C# having been in the PHP/Ruby/Python world for many years so I apologise if this is a dopey question.)
I'm doing some maintenance on an old C# app that is crashing whenever SmtpClient.Send() fails. From the little I've gleaned from the MSDN, I can see the obvious way to ...
It now makes sense that the versions aren't right.
I know I am using Castle Windsor 2.0 and I would like to use NHibernate with Fluent NHibernate - what versions do I need of these two?
Edit Ok, I think I got it wired up. I'm still having a version issue.
I now get this error when using the direct download from their site. The only lib...
Consider the following code
private int meth()
{
try
{
return 1;
}
catch(Exception ex)
{
return 2;
}
finally
{
return 3;
}
}
When the aforeseen code is compiled, "Exception" is treated as unchecked exception. That is "unreachable catch block Exception is never thrown in try block" compil...
Following on from a question here got me thinking....
Would it/is it possible that when an application encounters an unhandled exception for this exception object to be serialized and sent to a web service with a db backend. Then, using a utility or even within Visual Studio the exception object could be loaded from the db and inspected...
This might be a GDB question.. but I'd like to run my app in the debugger and have the debugger break when an exception is thrown, so I can see where the code is and what its doing at that time.
I do this often in Visual Studio using the Debug -> Exceptions dialog, checking the 'Thrown' column beside the type of exceptions I'd like to s...
I'm pretty sure I already know the answer, but I'm still curious what the opinion is on handling an error within a Try,Catch,Finally block -- but when you're repeating yourself.
BTW - I'm not talking about User Input - but using that for an example because it is clear and short
Consider this bit of code...
try {
if (success) {...
I thought BeautifulSoup will be able to handle malformed documents, but when I sent it the source of a page, the following traceback got printed:
Traceback (most recent call last):
File "mx.py", line 7, in
s = BeautifulSoup(content)
File "build\bdist.win32\egg\BeautifulSoup.py", line 1499, in __init__
File "build\bdist.win32...
Hi everyone,
I'm a newbie on Java EE and got a problem that I don't understand why it's happening.
Here is my problem :
I can't access a JavaBean using <jsp:getProperty> which is created in a scriptlet in the same page.It's throwing the below exception :
Attempted a bean operation on a null object.
Here is my bean and jsp page :
pac...