Re: Exception Identification - What to do with no codes? - Mailing list pgsql-jdbc

From Daniel Serodio
Subject Re: Exception Identification - What to do with no codes?
Date
Msg-id 1045252367.535.16.camel@kelly.ckf
Whole thread Raw
In response to Exception Identification - What to do with no codes?  (Derek S <cube-soft@rogers.com>)
List pgsql-jdbc
I only code server-side apps, so the machine configuration is less of an
issue. Our server is configured for US locale (even thou we're in
Brazil, I think non-translated messages are more "stable"), and I parse
the Exception's message for "duplicate key", for example.

We've only upgraded the PostgreSQL backend once, and the error messages
hadn't been changed. Of course, we can only hope that the error messages
don't change between releases.

I hope someone else on the list can shed some light on the issue of
localized messages.

Hope this helps a bit,
Daniel Serodio

On Fri, 2003-02-14 at 16:59, Derek S wrote:
> I've pored over the archives for this list, and as much documentation as
> I've been able to find and I understand that the back end needs to be
> updated before SQLException can be properly implemented in the JDBC
> driver with failure identification codes.
>
> I'm writing a fairly large application where certain causes of
> SQLExceptions are fatal to their particular transaction, but not fatal
> to the application itself.  Particularly, exceptions like duplicate key
> insertion failures and such will need to be reported to the user using
> friendly messages and dialog boxes.
>
> So my question is, with all of us living in this pre-error-code age, how
> are people typically building useful error messages for their users?  I
> can't very well expect a user to know that the product code they've
> entered is already taken from a message like "Cannot insert a duplicate
> key into unique index product_unique_code".  Is there an established
> practice that people use to handle this sort of thing that won't break
> if the user changes the localization settings on the server and/or client?
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
--
Daniel Serodio <daniel@checkforte.com.br>
CheckForte


pgsql-jdbc by date:

Previous
From: Derek S
Date:
Subject: Exception Identification - What to do with no codes?
Next
From: "Andy Kriger"
Date:
Subject: new driver questions