Avatar
https://developer.apple.com/documentation/foundation/nsurlsession/1407613-datataskwithrequest
If the request completes successfully, the data parameter of the completion handler block contains the resource data, and the error parameter is nil. If the request fails, the data parameter is nil and the error parameter contain information about the failure. If a response from the server is received, regardless of whether the request completes successfully or fails, the response parameter contains that information.
なので、data と error は exclusive だけど、response はエラー時でも入る可能性あることになっていますね。
🙏 1