Re: Exception Identification - What to do with no codes?

From: Daniel Serodio <daniel(at)checkforte(dot)com(dot)br>
To: PostgreSQL JDBC List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Exception Identification - What to do with no codes?
Date: 2003-02-14 19:52:47
Message-ID: 1045252367.535.16.camel@kelly.ckf
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)postgresql(dot)org)
--
Daniel Serodio <daniel(at)checkforte(dot)com(dot)br>
CheckForte

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Andy Kriger 2003-02-14 21:08:29 new driver questions
Previous Message Derek S 2003-02-14 18:59:20 Exception Identification - What to do with no codes?