mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-04-29 06:49:19 +08:00
Merge branch 'errcode' of github.com:OpenIMSDK/Open-IM-Server into errcode
This commit is contained in:
@@ -86,3 +86,13 @@ func Unwrap(err error) error {
|
||||
}
|
||||
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, ", "))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user