-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: use custom errors and wrap badgerv4 errors
- Loading branch information
Showing
2 changed files
with
51 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package badger | ||
|
||
import ( | ||
"errors" | ||
) | ||
|
||
var ( | ||
// ErrBadgerOpeningStore is returned when the badger store cannot be opened | ||
// or an error occurs while opening/creating the KVStore | ||
ErrBadgerOpeningStore = errors.New("error opening the store") | ||
// ErrBadgerUnableToSetValue is returned when the badger store fails to | ||
// set a value | ||
ErrBadgerUnableToSetValue = errors.New("unable to set value") | ||
// ErrBadgerUnableToGetValue is returned when the badger store fails to | ||
// retrieve a value | ||
ErrBadgerUnableToGetValue = errors.New("unable to get value") | ||
// ErrBadgerUnableToDeleteValue is returned when the badger store fails to | ||
// delete a value | ||
ErrBadgerUnableToDeleteValue = errors.New("unable to delete value") | ||
// ErrBadgerIteratingStore is returned when the badger store fails to | ||
// iterate over the database | ||
ErrBadgerIteratingStore = errors.New("unable to iterate over database") | ||
// ErrBadgerClearingStore is returned when the badger store fails to | ||
// clear all values | ||
ErrBadgerClearingStore = errors.New("unable to clear store") | ||
// ErrBadgerUnableToBackup is returned when the badger store fails to | ||
// backup the database | ||
ErrBadgerUnableToBackup = errors.New("unable to backup database") | ||
// ErrBadgerUnableToRestore is returned when the badger store fails to | ||
// restore the database | ||
ErrBadgerUnableToRestore = errors.New("unable to restore database") | ||
// ErrBadgerClosingStore is returned when the badger store fails to | ||
// close the database | ||
ErrBadgerClosingStore = errors.New("unable to close database") | ||
// ErrBadgerGettingStoreLength is returned when the badger store fails to | ||
// get the length of the database | ||
ErrBadgerGettingStoreLength = errors.New("unable to get database length") | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters