Thread: application readable error message

application readable error message

From
SunWuKung
Date:
Hi,
I am trying to return an application error message on certain db
raised errors to the form the info  came from.
What is the usual way for an application to identify the source of an
error?
The info (error type, table, column) is sometimes in the error message
sometimes not, but even when it is there trying to pars the human
readable message is surely not the best approach.

How do you people do it?
Thanks for the help.
SWK

Eg.
- null value in column "langid" violates not-null constraint - non-
null constraint violation, column, table
- ERROR:  insert or update on table "instrumentheader" violates
foreign key constraint "instrumentheader_fk"
  DETAIL:  Key (langid)=(ddd) is not present in table "lang". -
foreign key violation, column, table
  ERROR: ExecInsert: rejected due to CHECK constraint "username_valid"
  on "users" - check constraint violation, column, table
- ERROR:  invalid input syntax for integer: "sss" - datatype mismatch,
column, table


Re: application readable error message

From
Raymond O'Donnell
Date:
On 13/12/2008 19:13, SunWuKung wrote:

> I am trying to return an application error message on certain db
> raised errors to the form the info  came from.
> What is the usual way for an application to identify the source of an

I suppose it depends on your development language/environment.... I use
Delphi a lot, and exceptions contain the error message.

Ray.


------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

Re: application readable error message

From
SunWuKung
Date:
On Dec 14, 9:31 pm, r...@iol.ie ("Raymond O'Donnell") wrote:
> On 13/12/2008 19:13, SunWuKung wrote:
>
> I suppose it depends on your development language/environment.... I use
> Delphi a lot, and exceptions contain the error message.

Sure, but it would mean parsing the text of the error messages - and
they probably change among versions and languages.
What I wanted to know is if there is a way to get this information as
variable/value pairs.

Thx.
SWK