mirror of
https://github.com/muun/recovery.git
synced 2025-11-10 05:59:44 -05:00
Release 2.0.0
This commit is contained in:
28
vendor/github.com/muun/libwallet/errors/errors.go
generated
vendored
Normal file
28
vendor/github.com/muun/libwallet/errors/errors.go
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
package errors
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type Error struct {
|
||||
err error
|
||||
code int64
|
||||
}
|
||||
|
||||
func (e *Error) Error() string {
|
||||
return e.err.Error()
|
||||
}
|
||||
|
||||
func (e *Error) Code() int64 {
|
||||
return e.code
|
||||
}
|
||||
|
||||
func New(code int64, msg string) error {
|
||||
return &Error{errors.New(msg), code}
|
||||
}
|
||||
|
||||
func Errorf(code int64, format string, a ...interface{}) error {
|
||||
err := fmt.Errorf(format, a...)
|
||||
return &Error{err, code}
|
||||
}
|
||||
Reference in New Issue
Block a user