rollback current transaction before trying to report SQL query errors, properly save database error messages when logging query errors