Re: How to handle exceptions in constructor?
- From: "George George via JavaKB.com" <forum@xxxxxxxxxx>
- Date: Wed, 29 Jun 2005 03:33:40 GMT
Thanks Thomas,
Thomas G. Marshall wrote:
>Thomas G. Marshall coughed up:
>> George George via JavaKB.com coughed up:
>>> Hello everyone,
>[quoted text clipped - 22 lines]
>> already part of the java.lang.RunTimeException tree, and rethrow it
>> as one of your own.
>
>I am hysterically unclear here, sorry.
>
>What I mean to say is that there are odd cases where you may simply wish to
>roll your own exception for the /sole/ reason to make the callers /not/ have
>to use a try/catch.
>
>If this is the only reason you do it, then it is called *Bad Design*, but
>I've seen it before.
>
>I should have labeled this has #2, and listed the second item below as #1.
>
>This is a mess of a message, and I sincerely apologize.
>
>> This is because RunTimeException and subclasses
>> do not require a throws clause in the function definition, and you
>> may really desire that your function not require this.
>
>So that your users do not have to use try/catch.
>
>> In general, I
>> would suggest making at least /some/ of your exceptions extend
>[quoted text clipped - 7 lines]
>>
>> ...[rip]...
>
Never mind. Your replies are very helpful and you are a warm-hearted expert. :
-)
regards,
George
--
Message posted via http://www.javakb.com
.
- References:
- How to handle exceptions in constructor?
- From: George George via JavaKB.com
- How to handle exceptions in constructor?
- Prev by Date: Re: How to handle exceptions in constructor?
- Next by Date: drawing arrows...
- Previous by thread: Re: How to handle exceptions in constructor?
- Next by thread: formatting floats in a table
- Index(es):
Relevant Pages
|