mirror of
https://github.com/muun/recovery.git
synced 2025-11-11 14:30:19 -05:00
Release 2.0.0
This commit is contained in:
22
vendor/github.com/muun/libwallet/errors.go
generated
vendored
Normal file
22
vendor/github.com/muun/libwallet/errors.go
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
package libwallet
|
||||
|
||||
const (
|
||||
ErrUnknown = 1
|
||||
ErrInvalidURI = 2
|
||||
ErrNetwork = 3
|
||||
ErrInvalidPrivateKey = 4
|
||||
ErrInvalidDerivationPath = 5
|
||||
ErrInvalidInvoice = 6
|
||||
)
|
||||
|
||||
func ErrorCode(err error) int64 {
|
||||
type coder interface {
|
||||
Code() int64
|
||||
}
|
||||
switch e := err.(type) {
|
||||
case coder:
|
||||
return e.Code()
|
||||
default:
|
||||
return ErrUnknown
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user