mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-05 17:40:24 +08:00
优化错误处理相关代码
This commit is contained in:
@@ -2,6 +2,7 @@ package rpcutils
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type UserType = string
|
||||
@@ -27,5 +28,5 @@ func Wrap(description string, err error) error {
|
||||
if err == nil {
|
||||
return errors.New(description)
|
||||
}
|
||||
return errors.New(description + ": " + err.Error())
|
||||
return fmt.Errorf("%s: %w", description, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user