How to get the message from a firebird db-exception?

Forum related to Firebird

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
Ostfriese
Junior Boarder
Junior Boarder
Posts: 25
Joined: 12.05.2009, 10:48
Location: Coburg
Contact:

How to get the message from a firebird db-exception?

Post by Ostfriese »

If an exception from a firebird db is raised, Delphi raises an exception like
SQL Error: exception 1 NOT_ALLOWED Zugriff verweigert At trigger 'CHECKUSER' line: 7, col: 32. Error Code: -836. exception.
which is sometimes simply overloaded. Especialy if you only need the raw exception messag - in this case -
Zugriff verweigert
But I can't find any way to parse the delphi exception message for the db-exceptions message.

Does anyone have an idea for this problem?
Thomas Jefferson wrote:Information ist die Währung der Demokratie
seawolf
Zeos Dev Team *
Zeos Dev Team *
Posts: 385
Joined: 04.06.2008, 19:50
Contact:

Post by seawolf »

At the moment is not possible but take a look at the unit

..\src\dbc\ZdbcInterbase6Utils.pas

procedure CheckInterbase6Error

that line

raise EZSQLException.CreateWithCode(ErrorCode,
Format('SQL Error: %s. Error Code: %d. %s',
[ErrorMessage, ErrorCode, ErrorSqlMessage]) + SQL);

display exception, so changing it you can achieve that request
Post Reply