|
|
|
@@ -199,3 +199,11 @@ func ParseCodeDataJSONResponse[T any](resp *http.Response, ret T) error { |
|
|
|
|
|
|
|
return fmt.Errorf("unknow response content type: %s, status: %d, body[:200]: %s", contType, resp.StatusCode, strCont) |
|
|
|
} |
|
|
|
|
|
|
|
func IsErrorCode(err error, code string) bool { |
|
|
|
if e, ok := err.(*CodeMessageError); ok { |
|
|
|
return e.Code == code |
|
|
|
} |
|
|
|
|
|
|
|
return false |
|
|
|
} |