mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-26 11:36:44 +08:00
wrap
This commit is contained in:
parent
26341a5187
commit
2e24846e15
@ -86,3 +86,13 @@ func Unwrap(err error) error {
|
|||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Wrap(err error, msg ...string) error {
|
||||||
|
if err == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
if len(msg) == 0 {
|
||||||
|
return errors.WithStack(err)
|
||||||
|
}
|
||||||
|
return errors.Wrap(err, strings.Join(msg, ", "))
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user