on 2/3/00 10:13 PM, Kevin A. Burton <[EMAIL PROTECTED]> wrote:
> jon * wrote:
>>
>>> catch ( ClassNotFoundException e )
>>> {
>>> + e.printStackTrace();
>>> throw new Exception ( "Requested Screen not found: " + name );
>>> }
>>> return screen;
>>
>> Kevin,
>>
>> I'm -1 on this change because it is something that should be caught higher
>> up. You should catch that exception somewhere else...because it has a "nice"
>> error message in it. If you want to print a stack trace from that exception
>> later on, then that is fine
>
> No... it really isn't. Yes. It is true you get a stack trace but the
> trace only goes up to the point where your did "throw new Exception".
That is fine...it is a dead end at that point.
> The previous stack trace is wiped out. This is why I took both roads
> with this:
>
> 1. The user gets a "Reguested Screen not found"
> 2. The Engineer/Admin get's the full stack trace and can figure out
> where the problem is really occuring.
In this case, the problem is clear. There is no need for the
printStackTrace().
> We can make it better handled where I print the stack trace to a
> PrintWriter and then call log() on the string. This would add the
> exception to the Servlet Engine error log.
NO. You are totally missing my point. This is something that should be
thrown up.
>> (it is usually done from within the Turbine
>> servlet directly, but i can see you wanting to do it elsewhere), but I don't
>> think it should happen there.
>
> Does the above address this?
No.
>> Please back that change out. I also really do not want to clutter the code
>> up with a bunch of printStackTraces()...that was one of the motivations
>> behind Turbine in the first place.
>
> Let me know if the above doesn't change your mind and I will take it
> out.
It didn't change my mind. Please take it out.
>> Preventing that and catching errors in
>> one single location to prevent this.
>
> Yes. I do like the Exception that is thrown (except I would have thrown
> a TurbineException) and I agree it is the right way to do it however I
> also want the stack trace.
Problem with specific exceptions in this case is that we have to make sure
to throw them. In this case, it is easy with just Exception.
-jon
--
Come to the first official Apache Software Foundation
Conference! <http://ApacheCon.Com/>
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]