diff --git a/sdk/client/api_application_resource.go b/sdk/client/api_application_resource.go index 076c7dfe..2be3be28 100644 --- a/sdk/client/api_application_resource.go +++ b/sdk/client/api_application_resource.go @@ -252,8 +252,8 @@ func (a *ApplicationResourceApiService) CreateApplication(ctx context.Context, b } if httpResponse.StatusCode >= 300 { - newErr := GenericSwaggerError{ - body: responseBody, + newErr := GenericSwaggerErrorV2{ + body: string(responseBody), error: httpResponse.Status, } return nil, httpResponse, newErr diff --git a/sdk/client/generic_swagger_error.go b/sdk/client/generic_swagger_error.go index 96a38b68..4b20ce6a 100644 --- a/sdk/client/generic_swagger_error.go +++ b/sdk/client/generic_swagger_error.go @@ -18,16 +18,37 @@ type GenericSwaggerError struct { model interface{} } +type GenericSwaggerErrorV2 struct { + body string + error string + model interface{} +} + // Error returns non-empty string if there was an error. -func (e GenericSwaggerError) Error() string { +func (e GenericSwaggerErrorV2) Error() string { return fmt.Sprintf("error: %s, body: %s", e.error, e.body) } // Body returns the raw bytes of the response -func (e GenericSwaggerError) Body() []byte { +func (e GenericSwaggerErrorV2) Body() string { return e.body } +// Model returns the unpacked model of the error +func (e GenericSwaggerErrorV2) Model() interface{} { + return e.model +} + +// Error returns non-empty string if there was an error. +func (e GenericSwaggerError) Error() string { + return fmt.Sprintf("error: %s, body: %s", e.error, e.body) +} + +// Body returns the raw bytes of the response +func (e GenericSwaggerError) Body() string { + return string(e.body) +} + // Model returns the unpacked model of the error func (e GenericSwaggerError) Model() interface{} { return e.model