You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was following the process() function in Request.swift (see below), error says ("The request timed out."); the response says success (Status Code: 200,); data is nil. The three messages are not consistent, which causes a runtime error (Thread 8: Fatal error: Unexpectedly found nil while unwrapping an Optional value), when unwrapping "data".
privatefunc process(request:NSMutableURLRequest,
onCompletion:@escapingAmadeusResponse){letsession=URLSession.shared
lettask= session.dataTask(with: request asURLRequest, completionHandler:{ data, response, error invaramadeusResponse:Response?varamadeusError:ResponseError?
if let httpResponse = response as?HTTPURLResponse{// got a valid HTTP answer
amadeusResponse =Response(response: httpResponse, data: data!)// Error could be either nil (200 OK) or enum value
amadeusError = amadeusResponse!.getErrorCode()}else{// no HTTP answer: network problem
amadeusResponse =nil
amadeusError =ResponseError.returnedError(error!)}onCompletion(amadeusResponse, amadeusError)})
task.resume()}```
The text was updated successfully, but these errors were encountered:
Reported by
Feng
There are conflicting statuses:
I was following the process() function in Request.swift (see below), error says ("The request timed out."); the response says success (Status Code: 200,); data is nil. The three messages are not consistent, which causes a runtime error (Thread 8: Fatal error: Unexpectedly found nil while unwrapping an Optional value), when unwrapping "data".
The text was updated successfully, but these errors were encountered: