添加文件: ymt_v3_generate/errors.go

This commit is contained in:
renzhiyuan 2026-07-21 10:13:03 +08:00
parent 59c76e8b7e
commit 7d5dd449b0
1 changed files with 14 additions and 0 deletions

14
ymt_v3_generate/errors.go Normal file
View File

@ -0,0 +1,14 @@
package ymt_v3_generate
import "fmt"
// APIError 表示 API 返回的业务错误
type APIError struct {
Code int `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)
}