I agree. From what I understand, the compiler can't optimize code directly
within try/catch blocks, so you want to catch Exceptions as high up in the
framework as possible.
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Frank Kim
Sent: Tuesday, March 14, 2000 3:59 PM
To: Turbine
Subject: RE: Throwing "Exception" from withinTurbineinsteadof
"TurbineException"
I agree that it is a good idea to throw TurbineException because it helps
differentiate between turbine specific exceptions and other exceptions. But
I don't want to have to catch Exceptions within a given method and then cast
it into a TurbineException. I think we can leave the method signatures to
throw plain old Exception and just throw TurbineException (or subclasses of
it like InvalidPermissionException) within a particular method where
necessary. For example, the Loaders could throw TurbineException to make it
clear that it's a Turbine problem of not being able to find a class. That
way Turbine will still catch all exceptions in one place and we'll be able
to differentiate between Turbine generated exceptions and other exceptions.
Different applications have different exception handling frameworks and I
think Turbine's strategy of catching and then logging, displaying, etc all
exceptions in one place is a good one.
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of John McNally
> Sent: Tuesday, March 14, 2000 9:47 AM
> To: Turbine
> Subject: Re: Throwing "Exception" from within Turbineinsteadof
> "TurbineException"
>
>
> I am guilty of overusing Exception and casting up to Exception in
> the throws
> clause when I know the more specific Exception, but I know that
> somewhere up
> the chain it is going to get cast anyway, so my laziness.
>
> Other times I have felt we should be throwing more specific
> Exceptions. One
> such place might be an InvalidPermissionException, which Turbine
> could then
> watch for instead of having every screen and action dealing with it on its
> own. This is something I was planning to do in FreeTrade; I'm not sure if
> Frank has already added this.
>
> Now to the point of a TurbineException. Having an exception to
> use instead
> of Exception would be useful in many places where we don't want to name a
> more specific Exception and we now throw the general Exception
> .
> But:
> I suppose a place where this might be used would be in the throws
> clause of
> the actions/screens/navigations build method to replace the
> Exception there.
> While this might be better practice, I think it would mean we
> would have to
> catch exceptions in all these places and wrap them in a TurbineException.
> This would require rewriting a lot of code, so while I won't -1,
> I certainly
> would not look forward to it.
>
> John McNally
>
>
> ----- Original Message -----
> From: jon * <[EMAIL PROTECTED]>
> To: Turbine <[EMAIL PROTECTED]>
> Sent: Monday, March 13, 2000 10:49 PM
> Subject: Re: Throwing "Exception" from within Turbine insteadof
> "TurbineException"
>
>
> > I want to hear what Frank and John think of this before I will comment.
> >
> > -jon
> >
> >
> >
> > ------------------------------------------------------------
> > To subscribe: [EMAIL PROTECTED]
> > To unsubscribe: [EMAIL PROTECTED]
> > Problems?: [EMAIL PROTECTED]
> >
>
>
>
> ------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Problems?: [EMAIL PROTECTED]
>
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]