patch: PSQLException cleanups & exception chaining - Mailing list pgsql-jdbc

From Oliver Jowett
Subject patch: PSQLException cleanups & exception chaining
Date
Msg-id 20031202062321.GG19205@opencloud.com
Whole thread Raw
List pgsql-jdbc
In this patch (gzipped to avoid the message size limit):

 - Support for 1.4-style exception chaining to PSQLException
 - Various cleanups to PSQLException (ctors, don't override where not necessary)
 - Set "vendor code" of PSQLException to the hashcode of the message key
   (this is pretty speculative but might be useful to someone for identifying
   particular exceptions irregardless of locale?)
 - Change parsing of V3 server errors to avoid a trailing newline on the
   resulting exception message.

This has been tested on JDK1.4/JDBC3 vs. a 7.3 and 7.4 server. I don't have
the resources to test other combinations but I've kept them in mind while
making the changes.

Note that PSQLException.java is removed entirely by this patch and replaced
by PSQLException.java.in (needed to support the differences in Throwable
between 1.4 and earlier revisions).

With this patch, a PSQLException built under 1.4 will store any nested
exception via initCause() instead of extracting the whole stack trace into
the exception message itself.

Also, nested exceptions are no longer considered arguments for
internationalization of exception messages. I've corrected the English
error.properties but not other translations. It should be pretty harmless
anyway -- some stray unexpanded {0} or {1} markers in the resulting
messages.

-O

Attachment

pgsql-jdbc by date:

Previous
From: ListMan
Date:
Subject: Re: Problem with PGStatement.getLastOID()
Next
From: Oliver Jowett
Date:
Subject: patch: improve exception propagation in testcases