mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
script
This commit is contained in:
parent
0aa0b257ee
commit
2ccf040fbb
@ -22,22 +22,19 @@ func CopyStructFields(a interface{}, b interface{}, fields ...string) (err error
|
||||
}
|
||||
|
||||
func Wrap1(err error) error {
|
||||
if err != nil {
|
||||
return Wrap(err, "")
|
||||
}
|
||||
return nil
|
||||
return errors.Wrap(err, "==> " + printCallerNameAndLine())
|
||||
}
|
||||
|
||||
func Wrap2[T any](a T, err error) (T, error) {
|
||||
if err != nil {
|
||||
return a, Wrap(err, "")
|
||||
return a, errors.Wrap(err, "==> " + printCallerNameAndLine())
|
||||
}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
func Wrap3[T any, V any](a T, b V, err error) (T, V, error) {
|
||||
if err != nil {
|
||||
return a, b, Wrap(err, "")
|
||||
return a, b, errors.Wrap(err, "==> " + printCallerNameAndLine())
|
||||
}
|
||||
return a, b, nil
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user