walletdb: add new ErrDryRunRollBack error
We need a way to signal that a DB transaction should be rolled back because its changes were a dry-run only. We add a new specific error for that case so the automatic rollback on error in the walletdb.View and walletdb.Update comes to play. But we can still return the result of a dry-run where we need to by inspecting for this specific error.
This commit is contained in:
parent
33a0a065f9
commit
9c839caddf
1 changed files with 4 additions and 0 deletions
|
@ -39,6 +39,10 @@ var (
|
||||||
|
|
||||||
// ErrInvalid is returned if the specified database is not valid.
|
// ErrInvalid is returned if the specified database is not valid.
|
||||||
ErrInvalid = errors.New("invalid database")
|
ErrInvalid = errors.New("invalid database")
|
||||||
|
|
||||||
|
// ErrDryRunRollBack is returned if a database transaction should be
|
||||||
|
// rolled back because its changes were a dry-run only.
|
||||||
|
ErrDryRunRollBack = errors.New("dry run only; should roll back")
|
||||||
)
|
)
|
||||||
|
|
||||||
// Errors that can occur when beginning or committing a transaction.
|
// Errors that can occur when beginning or committing a transaction.
|
||||||
|
|
Loading…
Reference in a new issue