-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Catch panic from bbolt open connection
- Loading branch information
Showing
2 changed files
with
70 additions
and
33 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,20 @@ | ||
package offline | ||
|
||
import ( | ||
"fmt" | ||
) | ||
|
||
// ErrOpenDB is an error returned when the database cannot be opened. | ||
type ErrOpenDB struct { | ||
Err error | ||
} | ||
|
||
// Error method to implement error interface. | ||
func (e ErrOpenDB) Error() string { | ||
return e.Err.Error() | ||
} | ||
|
||
// Message method to implement wakaerror.Error interface. | ||
func (e ErrOpenDB) Message() string { | ||
return fmt.Sprintf("failed to open db connection: %s", e.Err) | ||
} |
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