Allow exception name and possibly exception text to be determined within a "WHEN ANY" error handling block [CORE2040] #947
Submitted by: Alastair Breingan (alb)
Firebird allows GDSCODE and SQLCODE to be retrieved when handling errors, but not the exception name and text, which will normally be much more common.
This does not allow for a generic error handling routine, which, for example might log the error and re-signal the exception, or for the more user-friendly reporting of all validation errors raised by a trigger (rather than just the first).
Please note that while the text is useful the name is the critical part as the text can always be retrieved from the system tables.
====== Test Details ======
The text was updated successfully, but these errors were encountered:
Modified by: @dyemanov
summary: Allow Excepption Name and possibly exception text to be determined within a "WHEN ANY" error handling block. => Allow exception name and possibly exception text to be determined within a "WHEN ANY" error handling block
Commented by: Philip Williams (unordained)
In a case like that, both the name of the exception (e_some_error) and the exact message are important; the message cannot be looked up in system tables, as the one defined for e_some_error is probably simply 'A value could not be inserted into a field because of a rule violation', something generic for documentation purposes.