db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <Knut.Hat...@Sun.COM>
Subject Re: [jira] Commented: (DERBY-2472) Use Throwable.initCause() to improve error reporting
Date Tue, 22 May 2007 21:22:59 GMT
Bryan Pendleton <bpendleton@amberpoint.com> writes:

> Thanks for the very clear explanation, Knut Anders!
>
>> As I can't see that the subsequent exceptions will provide any
>> significant value, I'm tempted to go for this solution. The code will be
>> a lot simpler this way, and I think it would also be clearer what the
>> problem is if an exception is thrown. As it is today, the last exception
>> we caught is the one that is re-thrown. This exception may have a
>> message that is completely unrelated to the real error, which you only
>> see if you go to the end of the chain.
>
> +1 to all of these conclusions. The first exception is the most
> important, and attempting to amalgamate multiple exception chains
> into a single chain can mislead the user. Re-throwing the last exception
> seems like an inferior choice to re-throwing the first.

If it only were that simple... I made the change in
GenericLanguageConnectionContext and BasicDependencyManager and ran
derbyall and suites.All. Both had two new failures. Here's one of the
diffs (they all were similar):

********* Diff file derbyall/derbylang/fk_nonSPS.diff
*** Start: fk_nonSPS jdk1.6.0_01 derbyall:derbylang 2007-05-22 17:44:47 ***
321,323d320
< ERROR X0Y25: Operation 'DROP CONSTRAINT' cannot be performed on object 'PK1' because
CONSTRAINT 'FK' is dependent on that object.
< ERROR X0Y25: Operation 'DROP CONSTRAINT' cannot be performed on object 'PK1' because
CONSTRAINT 'FK2' is dependent on that object.
< ERROR X0Y25: Operation 'DROP CONSTRAINT' cannot be performed on object 'PK1' because
CONSTRAINT 'FK3' is dependent on that object.
326,328d322
< ERROR X0Y25: Operation 'DROP CONSTRAINT' cannot be performed on object 'PK1' because
CONSTRAINT 'FK' is dependent on that object.
< ERROR X0Y25: Operation 'DROP CONSTRAINT' cannot be performed on object 'PK1' because
CONSTRAINT 'FK2' is dependent on that object.
< ERROR X0Y25: Operation 'DROP CONSTRAINT' cannot be performed on object 'PK1' because
CONSTRAINT 'FK3' is dependent on that object.
Test Failed.
*** End:   fk_nonSPS jdk1.6.0_01 derbyall:derbylang 2007-05-22 17:45:09 ***

Before, the exception chain would show all the objects that were
dependent on the object being dropped, whereas with the change, only one
of the dependent objects is shown. I still think we don't lose very
important information, but I also see the value of getting all the
dependent objects at once. Any opinions on this?

-- 
Knut Anders

Mime
View raw message