Delphi / Object Pascal · Database exception

TDBXError Exception (dbExpress)

What does TDBXError Exception (dbExpress) mean in Delphi / Object Pascal?

The single exception class for all dbExpress (TDBX) framework errors. Rather than most dbExpress methods returning error codes, they raise TDBXError uniformly, with the specific failure identified through its error code from TDBXErrorCodes.

TDBXError Exception (dbExpress)Delphi (VCL) · Delphi (FireMonkey) · Delphi (dbExpress)

Condition

The single exception class for all dbExpress (TDBX) framework errors. Rather than most dbExpress methods returning error codes, they raise TDBXError uniformly, with the specific failure identified through its error code from TDBXErrorCodes.

Fix

Check the exception's error code against the TDBXErrorCodes constants to branch handling - connection failure versus bad credentials versus unsupported feature - instead of parsing the message text, which can vary by driver.

Related database exception