[RESOURCE] NSURLError Aliasing Cheat Sheet for NRQL (iOS Only)

Hello,

Today I found myself manually writing out aliases for all NSURLError codes in the 1000s, and thought sharing it might help someone save some time. So here’s a query snippet you can adjust to your needs:

facet(cases(where code = '-1000' as 'BadURL', where code = '-1001' as 'TimedOut', where code ='-1002' as 'UnsupportedURL', where code = '-1003' as 'CannotFindHost', where code = '-1004' as ' CannotConnectToHost', where code = '-1005' as 'NetworkConnectionLost', where code = '-1006' as 'DNSLookupFailed', where code = '-1007' as 'HTTPTooManyRedirects', where code = '-1008' as 'ResourceUnavailable', where code = '-1009' as 'NotConnectedToInternet', where code = '-1010' as 'RedirectToNonexistentLocation', where code = '-1011' as 'BadServerResponse', where code = '-1012' as 'UserCancelledAuthentication', where code = '-1013' as 'UserAuthenticationRequired', where code = '-1014' as 'ZeroByteResource', where code = '-1015' as 'CannotDecodeRawData', where code = '-1016' as 'CannotDecodeContentData', where code = '-1017' as 'CannotParseResponse', where code = '-1022' as 'AppTransportSecurityRequiresSecureConnection'))

Here’s to hoping this kind of thing is allowed. I’ve found shortcuts on these forums that have helped me immensely so just wanted to provide something that might be useful in saving time/labor.

5 Likes

@ashley.carey THANK YOU :star_struck: for sharing this resource. I’m sure it will be helpful to other community members as well!