openapi-generator/samples/client
Ryan Martin c1f3c51427 [Swift] Include HTTP status code and body data in response errors
This is useful when differentiating different error responses. Example:

if let e = error {
  switch e {
    case ErrorResponse.Error(400, _, _): responseLabel.text = "Unknown error"
    case ErrorResponse.Error(403, _, _): responseLabel.text = "Not logged in"
    default: responseLabel.text = "\(e)"
  }
}

The existing error is straight from Alamofire and only includes the HTTP
status code in the body of the message (not broken out as a separate value).
It also does not include the response body, which may be useful.
2016-08-22 12:30:03 -04:00
..
petstore [Swift] Include HTTP status code and body data in response errors 2016-08-22 12:30:03 -04:00
petstore-security-test Merge pull request #3534 from arnested/php-enums-in-containers 2016-08-08 18:29:44 +08:00