Improved error handling in vchasno responses

This commit is contained in:
2026-01-16 02:27:09 +03:00
parent 28a8810ffb
commit 861a1640d4
2 changed files with 30 additions and 0 deletions

View File

@@ -15,6 +15,17 @@ type BaseResponse struct {
ErrorExtra interface{} `json:"error_extra"`
}
func (r *BaseResponse) HasError() bool {
return r.Res != 0
}
func (r *BaseResponse) Error() string {
if r.Errortxt != "" {
return r.Errortxt
}
return ""
}
type SellResponse struct {
BaseResponse
Info SellInfo `json:"info"`