Currently when an SQL error happens during script run, then it's logged into System Log and following happens:
|Debug Mode Enabled||Debug Mode Disabled|
|"DBG_SQL_FAILURE" enabled||Exception thrown||Warning triggered|
|"DBG_SQL_FAILURE" disabled||Warning triggered||Warning triggered|
This can result in data integrity issues.
Proposing to always (controlled by setting, enabled by default) throw an exception on SQL errors.
- 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
- remove the "DBG_SQL_FAILURE" debugger setting (debugger now would consider this turned off by default)
- in the "kLogger" class when catching SQL errors use above added setting to decide what to do with them
- [system log] Special template for fatal errors and uncatched exceptions [5.3.0-B1] (without this there would be a blank screen)