Cleanup lint
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
This commit is contained in:
parent
537ff23a63
commit
e513884a5a
@ -12,9 +12,8 @@ func IsFatal(err ActorError) bool {
|
||||
func RetCode(err ActorError) uint8 {
|
||||
if err == nil {
|
||||
return 0
|
||||
} else {
|
||||
return err.RetCode()
|
||||
}
|
||||
return err.RetCode()
|
||||
}
|
||||
|
||||
type internalActorError interface {
|
||||
|
@ -6,7 +6,18 @@ import (
|
||||
"golang.org/x/xerrors"
|
||||
)
|
||||
|
||||
// New creates a new non-fatal error
|
||||
func New(retCode uint8, message string) ActorError {
|
||||
if retCode == 0 {
|
||||
return &actorError{
|
||||
fatal: true,
|
||||
retCode: 0,
|
||||
|
||||
msg: "tried creating an error and setting RetCode to 0",
|
||||
frame: xerrors.Caller(1),
|
||||
err: err,
|
||||
}
|
||||
}
|
||||
return &actorError{
|
||||
retCode: retCode,
|
||||
|
||||
@ -15,6 +26,7 @@ func New(retCode uint8, message string) ActorError {
|
||||
}
|
||||
}
|
||||
|
||||
// Wrap extens chain of errors with a message
|
||||
func Wrap(err ActorError, message string) ActorError {
|
||||
if err == nil {
|
||||
return nil
|
||||
@ -29,7 +41,7 @@ func Wrap(err ActorError, message string) ActorError {
|
||||
}
|
||||
}
|
||||
|
||||
// Wrap extens chain of errors with
|
||||
// Wrapf extens chain of errors with a message
|
||||
func Wrapf(err ActorError, format string, args ...interface{}) ActorError {
|
||||
if err == nil {
|
||||
return nil
|
||||
|
Loading…
Reference in New Issue
Block a user