dadata/client/error.go
Alexander Zhuravlev 4d8d739615 Wrap errors.
Added ResponseError.
Abstract transport encoding/decoding.
2023-05-07 14:15:49 +03:00

14 lines
280 B
Go

package client
import "fmt"
// ResponseError indicates an HTTP non-200 response code.
type ResponseError struct {
Status string // e.g. "200 OK"
StatusCode int // e.g. 200
}
func (e *ResponseError) Error() string {
return fmt.Sprintf("HTTP response: %s", e.Status)
}