title: Can we get the HttpStatus Code error description in swift?
body: <p>I am using Uber Api in my app. There is problem which occurs when I try to book a ride.I get a httpStatus 400 error. As per their documentation, this could arise due to a variety of factors.
  <a href="https://i.stack.imgur.com/ykaFI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ykaFI.png" alt="enter image description here"></a></p>
  
  <p>How can I know through status code(Always"400") as to which description of given types causes it?.</p>
  
  <p>My code now:</p>
  
  <pre><code> if let httpstatuscode = response as? NSHTTPURLResponse
          {
              if (error != nil)
              {
                  print("Error : \(error?.localizedDescription)")
              }
              else if httpstatuscode.statusCode != 202 &amp;&amp; httpstatuscode.statusCode != 409
              {
  
                  print("Status Code\(httpstatuscode.statusCode)")
  
                  dispatch_async(dispatch_get_main_queue(), { () -&gt; Void in
                      CommonViewController.alertViewUI("Alert", message: "Internal Server Error!")
                  })
  
              }
              else if httpstatuscode.statusCode == 409
              {
                 // self.getUberRideLive()
                  print("Status Code\(httpstatuscode.statusCode)")
                  CommonViewController.alertViewUI("Alert", message: "You are already on a ride!")
  
  
  
              }
  </code></pre>