The SqliteErrors.h
header provides a 1:1 mapping from SQLite's error codes with some custom exception.
The rationale for this header was to try and gain more insight about failing requests in an environment that doesn't display the type nor text of an unhandled exception in the crash reports. By looking at the mapToException
function line that threw the exception, one can guess what the error was.
An isInnucuous
helper is also provided and is used by the various sqlite::Tools
helpers to return false in case of a sporadic innocuous error. Hard errors (such as constraint violations, database locked, ...) will not be ignored and will systematically throw an exception