diff options
Diffstat (limited to 'vendor/github.com/go-openapi/runtime/client_response.go')
-rw-r--r-- | vendor/github.com/go-openapi/runtime/client_response.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/vendor/github.com/go-openapi/runtime/client_response.go b/vendor/github.com/go-openapi/runtime/client_response.go index 729e18b228..d97e0ac64f 100644 --- a/vendor/github.com/go-openapi/runtime/client_response.go +++ b/vendor/github.com/go-openapi/runtime/client_response.go @@ -17,6 +17,8 @@ package runtime import ( "fmt" "io" + + "encoding/json" ) // A ClientResponse represents a client response @@ -59,5 +61,10 @@ type APIError struct { } func (a *APIError) Error() string { - return fmt.Sprintf("%s (status %d): %+v ", a.OperationName, a.Code, a.Response) + resp, _ := json.Marshal(a.Response) + return fmt.Sprintf("%s (status %d): %s", a.OperationName, a.Code, resp) +} + +func (a *APIError) String() string { + return a.Error() } |