I think you need to increase the time interval of specific request where you are not receiving response with in timeline. If you are using Alamofire you can Increase time out interval by following.
Swift 3
let manager = Alamofire.SessionManager.default
manager.session.configuration.timeoutIntervalForRequest = 120
manager.request("yourUrl", method: .post, parameters: ["parameterKey": "value"])
Also in error call back you will receive
switch response.result {
case .success:
// Successfull API Response
case .failure(let error):
errorHandler(error)
print(error.localizedDescription)
if let error = error as? NSError {
print(error.code) // this will print error code
}
}
Let me know if you require any more help.