Does URLSession now always return a URLError if an error occurred, or is it only in some cases?

No. While I’ve never seen anything other than an NSURLErrorDomain come back from NSURLSession, the API does not guarantee that. If you want to treat the error as a URLError, you must conditionally cast it and do something reasonable if the cast fails.

More Like This

Retrieving data ...

This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Developer Forums Participation Agreement.