Subject Re: Repost: [Fwd: [Firebird-Java] GDS Error Codes in SQLExceptions/build.xml]
Author Roman Rokytskyy
Hi Mark,

> One thing I have found difficult, with that catch ... throw new
> SQLException() block, is that it hides the position of the original
> GDSException. The stacktrace for instance points to the new "throw
> new SQLException" line rather than that of the original error (I
> put printStackTrace() calls in to pin down the real reason/line).
>
> I assume there is a good reason (and excuse me if my ignorance is
> showing, since I really am not up to date with what's happening
> here) why GDSException doesn't inherit from SQLException or
> FBSQLException and even if caught, it just throws the same
> exception again.

I would say that GDSException is only the translation of FB error
codes into Java language. This exception is used to inform the JDBC
implementation about errors on the API level. Users usually are not
interested in what happened on API level, only on JDBC-level errors.
So, re-throwing exceptions seems to be ok here. I will check also if
we can handle javax.resource.ResourceException (JCA stuff) the same
way.

Best regards,
Roman