You are not logged in.
Pages: 1
Hello,
I`m trying to investigate how should i handle connection errors code. Especially with postgresql such as bad database name, invalid user password etc. Any advice? The exceptions doesnt have any code errors just, a message, wich can be either in English or other language depending on pgsql so its not a good way to check it. ZdbcPostgreSqlUtils: CheckPostgreSQLError
Thanks in advance.
Offline
I usually define my own Exception class, with its own set of high-level errors, if needed.
Then I could check the exact error from an enumeration value, in a:
try
...
except
on E: EMyExtendedClass do
begin
...
case E.AdvancedErrorCause of
...
end;
end;
end;
Then the addition information may be serialized as JSON - using published properties, e.g. to reproduce the full error message, or for logging, or for transmission as a REST service.
Offline
Hi, thanks for the reply.
So it seems that the zeos postgresql (maybe others) implementation should be extended as there is a ZSQLException but without any status code in the estabilishment of a connection part.
Offline
Pages: 1