Re: NSForwardException and InvocationTargetException?
Re: NSForwardException and InvocationTargetException?
- Subject: Re: NSForwardException and InvocationTargetException?
- From: Chuck Hill <email@hidden>
- Date: Wed, 26 Mar 2003 13:26:44 -0800
- Organization: Global Village Consulting, Inc.
Hi,
Jonathan Rochkind wrote:
Can anyone explain the weird relationship between
InvocationTargetException and NSForwardException?
The both serve a similar purpose: homogenization of API by providing an alias
for an exception.
If, just for testing purposes, I actually manually throw an
InvocationTargetException in my code... in
Applicaiton.handleException(), the exception I get passed in as an
argument is actually an NSForwardException
>
Yes, WO internally creates an NSForwardException to wrap any checked exception
not declared in the API.
----who's originalException()
is NOT an InvocationTargetException, but rather is the original
InvocationTargetException's getTargetException(). If you're following,
the InvocationTargetException has been magically transformed to a
similar NSForwardException. Which has had it's stack trace filled in to
the same line as the original InvocationTargetException, to make matters
more confusing.
Sounds like the NSForwardException constructor is being helpful with this
particular indirect exception type.
But, I am currently logging all exceptions that make it up to the
Application.handleException. And I DO have InvocationTargetExceptions
in the log. So sometimes InvocationTargetException IS passed in to
handleException.
>
Not all exceptions get to handleException. It seems to depend on where they are
raised. For example, some but not all OutOfMemory exceptions get passed here.
To make matters more mysterious, when I look at the
stackTrace of that logged InvocationTargetException---it's coming from a
line where I have no idea how that line could have generated an
InvocationTargetException. I expect it generated some other exception,
and WO chose to wrap it in an InvocationTargetException (instead of in
an NSForwardException?!?!)
InvocationTargetException "is a checked exception that wraps an exception thrown
by an invoked method or constructor." So the real exception was raised in some
other method invoked dynamically from that line. Maybe KVC doing something funky?
So, I'm not even sure what it is I'm asking. But there's something wacky
going on with WO and InvocationTargetException and NSForwardException.
Can anyone explain all this stuff? Is there useful documentation somewhere?
Was that of any use?
Chuck
--
Chuck Hill email@hidden
Global Village Consulting Inc. http://www.global-village.net
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.