添加文件: ymt_v3_2/errors.go
This commit is contained in:
parent
db6a614a88
commit
4887d41ae7
|
|
@ -0,0 +1,13 @@
|
||||||
|
package ymt_v3_2
|
||||||
|
|
||||||
|
import "fmt"
|
||||||
|
|
||||||
|
type APIError struct {
|
||||||
|
Code int32 `json:"code"`
|
||||||
|
Message string `json:"message"`
|
||||||
|
Reason string `json:"reason,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *APIError) Error() string {
|
||||||
|
return fmt.Sprintf("API error: code=%d, message=%s, reason=%s", e.Code, e.Message, e.Reason)
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue