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
Apple Swift version 3.0.2 (swiftlang-800.0.63 clang-800.0.42.1)
Apple Swift version 3.1 (swiftlang-802.0.31.3 clang-802.0.30.2)
Additional Detail from JIRA
Votes
0
Component/s
Foundation
Labels
Bug, RunTimeCrash, SDKOverlay
Assignee
None
Priority
Medium
md5: f69285efcb731f127ab4e37defb5f80a
Issue Description:
A new URL error was introduced, NSURLErrorAppTransportSecurityRequiresSecureConnection, but was never added to the Swift Foundation overlay. As a result, if you have an error with this code, casting to URLError and accessing the code property crashes. Given that we'll probably see other new error codes in the future, we probably shouldn't crash in this case, because even if we always update the Foundation overlay, that doesn't help apps compiled against an older SDK.
One possible solution would be to introduce a new case other(rawValue: Int) case to handle any unknown codes. We'd also need to implement == on URLError.Code at this point as we'd lose the default impl. An alternative solution is just to default to .unknown for unknown codes, but that means throwing away the actual code which isn't great.
The text was updated successfully, but these errors were encountered:
Environment
Apple Swift version 3.0.2 (swiftlang-800.0.63 clang-800.0.42.1)
Apple Swift version 3.1 (swiftlang-802.0.31.3 clang-802.0.30.2)
Additional Detail from JIRA
md5: f69285efcb731f127ab4e37defb5f80a
Issue Description:
A new URL error was introduced,
NSURLErrorAppTransportSecurityRequiresSecureConnection
, but was never added to the Swift Foundation overlay. As a result, if you have an error with this code, casting toURLError
and accessing thecode
property crashes. Given that we'll probably see other new error codes in the future, we probably shouldn't crash in this case, because even if we always update the Foundation overlay, that doesn't help apps compiled against an older SDK.Sample program:
This crashes on the access for
urlerr.code
.One possible solution would be to introduce a new
case other(rawValue: Int)
case to handle any unknown codes. We'd also need to implement==
onURLError.Code
at this point as we'd lose the default impl. An alternative solution is just to default to.unknown
for unknown codes, but that means throwing away the actual code which isn't great.The text was updated successfully, but these errors were encountered: