Ahh, didn't think of that. That's the badger.

Good work!

Thanks.

-----Original Message-----
From: Jon Wingfield [mailto:[EMAIL PROTECTED]
Sent: 05 December 2003 13:21
To: Tomcat Users List
Subject: Re: Illegal Access Error [ URLConnection ]


Yep. An Error isn't an Exception; it's a Throwable.
Inheritance tree:

           Throwable
               |
         --------------
        |              |
      Error        Exception

HTH,

Jon

Stuart Stephen wrote:
> I tried putting a try and catch block around it to catch a the generic
> Exception. Yet that didn't work.
>
> Something is still a-miss?
>
> -----Original Message-----
> From: SH Solutions [mailto:[EMAIL PROTECTED]
> Sent: 05 December 2003 11:37
> To: 'Tomcat Users List'
> Subject: AW: Illegal Access Error [ URLConnection ]
>
>
> Hi
>
>
>>When I do URLConnection.guessContentTypeFromName(filename) I get an
>
> IllegalAccessError thrown. Yet, I cannot catch this as the method only
> throws an IOException.
>
> I dont know where this comes from since I dont have any idea what this
> method is all about.
> But I can tell you how to catch the Exception.
>
> try {
>   ..
> } catch ( IllegalAccessError iae ) {
> }
>
> As of you post I guess you thought that you couldn't catch a Exception
that
> is not declared to be thrown by the method in question. But this is only
> half the truth. You can throw everything that inherits from Throwable.
> Descendents of Exception are such classes, but there are more.
>
> You can catch about everything if you use this;
>
> } catch ( Throwable t ) {
>   t.printStackTrace(); // not required but a good start.
> ...
>
> Cu
>   Steffen
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to