Child pages
  • [system log] Make SQL errors throw an exception [5.3.0-B1]
Skip to end of metadata
Go to start of metadata

Currently when an SQL error happens during script run, then it's logged into System Log and following happens:

 Debug Mode EnabledDebug Mode Disabled
"DBG_SQL_FAILURE" enabledException thrownWarning triggered
"DBG_SQL_FAILURE" disabledWarning triggeredWarning triggered

This can result in data integrity issues.

Proposing to always (controlled by setting, enabled by default) throw an exception on SQL errors.

Solution

  1. add a "DatabaseErrorHandlingMode" system setting (title: "Database Error Handling Mode"; new installs: 1; upgrades: 2) with following options:
    • 1 - Show Error Page
    • 2 - Do Nothing
  2. remove the "DBG_SQL_FAILURE" debugger setting (debugger now would consider this turned off by default)
  3. in the "kLogger" class when catching SQL errors use above added setting to decide what to do with them

Related Discussions

Related Tasks