forked from loafle/openapi-generator-original
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.