Commit 9669acc1 authored by gwenn's avatar gwenn

Improve backup error handling.

parent 0b0ed9e5
......@@ -52,8 +52,10 @@ func (b *Backup) Step(npage int) error {
rv := C.sqlite3_backup_step(b.sb, C.int(npage))
if rv == C.SQLITE_OK || Errno(rv) == ErrBusy || Errno(rv) == ErrLocked { // TODO Trace busy/locked errors
return nil
}
} else if rv == C.SQLITE_DONE {
return Errno(rv)
}
return b.dst.error(rv, "backup step failed")
}
// BackupStatus reports backup progression
......@@ -112,7 +114,7 @@ func (b *Backup) Close() error {
}
rv := C.sqlite3_backup_finish(b.sb)
if rv != C.SQLITE_OK {
return Errno(rv)
return b.dst.error(rv, "backup finish failed")
}
b.sb = nil
return nil
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment