         } catch let error1 as NSError {
             error = error1
             statement = nil
-            log.error("SQL error: \(error1.localizedDescription) for SQL \(sqlStr).")
         }
 
         // Close, not reset -- this isn't going to be reused.

            return nil
        }

        let status = immediately ? sqlite3_close(db) : sqlite3_close_v2(db)

        // Note that if we use sqlite3_close_v2, this will still return SQLITE_OK even if
        // there are outstanding prepared statements
        if status != SQLITE_OK {
            log.error("Got status \(status) while attempting to close.")
            return createErr("During: closing database with flags", status: Int(status))
        }

        log.debug("Closed \(self.filename).")

    func transaction(synchronous: Bool=true, transactionClosure: @escaping (_ db: SQLiteDBConnection) -> Bool) -> NSError? {
        return withConnection(SwiftData.Flags.readWriteCreate, synchronous: synchronous) { db in
            if let err = db.executeChange("BEGIN EXCLUSIVE") {
                log.error("BEGIN EXCLUSIVE failed. Error code: \(err.code), \(err)")
                SentryIntegration.shared.sendWithStacktrace(message: "BEGIN EXCLUSIVE failed. Error code: \(err.code), \(err)", tag: "SwiftData", severity: .error)
                return err
            }

            if transactionClosure(db) {
                log.verbose("Op in transaction succeeded. Committing.")

                if let err = db.executeChange("COMMIT") {
                    log.error("COMMIT failed. Rolling back. Error code: \(err.code), \(err)")
                    SentryIntegration.shared.sendWithStacktrace(message: "COMMIT failed. Rolling back. Error code: \(err.code), \(err)", tag: "SwiftData", severity: .error)

                    if let rollbackErr = db.executeChange("ROLLBACK") {
                        log.error("ROLLBACK after failed COMMIT failed. Error code: \(rollbackErr.code), \(rollbackErr)")
                        SentryIntegration.shared.sendWithStacktrace(message: "ROLLBACK after failed COMMIT failed. Error code: \(rollbackErr.code), \(rollbackErr)", tag: "SwiftData", severity: .error)
                    }

                    return err
                }
            } else {
                log.error("Op in transaction failed. Rolling back.")
                SentryIntegration.shared.sendWithStacktrace(message: "Op in transaction failed. Rolling back.", tag: "SwiftData", severity: .error)

                if let err = db.executeChange("ROLLBACK") {
                    log.error("ROLLBACK after failed op in transaction failed. Error code: \(err.code), \(err)")
                    SentryIntegration.shared.sendWithStacktrace(message: "ROLLBACK after failed op in transaction failed. Error code: \(err.code), \(err)", tag: "SwiftData", severity: .error)
                    return err
                }
            }
