Another PostgreSQL question

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
snorkel
Posts: 384
Joined: Tue 08 Aug 2006 15:10
Location: Milwaukee WI USA

Another PostgreSQL question

Post by snorkel » Wed 19 Nov 2008 17:46

Hi,
Does the Unidac exception handler fully support the error messages PostgreSQL returns?

Please see:
http://www.postgresql.org/docs/8.3/inte ... ields.html

It's important that these error fields be surfaced to the exception handler because they contain critical informaton like the line number the error occured at etc.

Snorkel

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Thu 20 Nov 2008 06:57

For this you can use the InnerError property of the EUniError class which points (for PostgreSQL provider) to the instance of EPgError class. For example:

Code: Select all

   ShowMessage((E.InnerError as EPgError).CallStack)

snorkel
Posts: 384
Joined: Tue 08 Aug 2006 15:10
Location: Milwaukee WI USA

Post by snorkel » Thu 20 Nov 2008 16:05

Challenger wrote:For this you can use the InnerError property of the EUniError class which points (for PostgreSQL provider) to the instance of EPgError class. For example:

Code: Select all

   ShowMessage((E.InnerError as EPgError).CallStack)
Ok, but will it have access to all the PgSQL error fields like line number etc?

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Fri 21 Nov 2008 06:09

Yes.

Post Reply