Re: What generates NSURLErrorUnsupportedURL?

2017-02-08 Thread Steve Christensen
Thanks Greg (and Jens). The URLs are coming from a server that the app uses. I 
haven't seen these errors in the past so somebody was probably doing some 
tinkering and messed something up.


> On Feb 8, 2017, at 7:16 PM, Greg Parker  wrote:
> 
>> On Feb 8, 2017, at 2:44 PM, Jens Alfke  wrote:
>> 
>>> On Feb 8, 2017, at 10:38 AM, Steve Christensen  wrote:
>>> 
>>> The time between when the request is made and when it completes with an 
>>> error might be a minute or so, so the framework is immediately bailing on 
>>> the request. I'm wondering what part of the process generates the error. 
>>> Does the server return a non-200 status code or what?
>> 
>> The server is probably returning a redirect (301, 302 or 303) to a bogus URL.
> 
> NSURLErrorUnsupportedURL in a background session is specifically a complaint 
> that the URL is neither http nor https. Perhaps the server redirected to 
> something else?
> 
> 
>> There’s a delegate method you can implement to see the redirected URL, which 
>> could help you troubleshoot this. But it sounds like it’s the server’s fault.
> 
> The bad URL is also recorded in the NSError's userInfo dictionary as 
> NSURLErrorFailingURLStringErrorKey.
> 
> -- 
> Greg Parker gpar...@apple.com Runtime Wrangler


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: What generates NSURLErrorUnsupportedURL?

2017-02-08 Thread Greg Parker

> On Feb 8, 2017, at 2:44 PM, Jens Alfke  wrote:
> 
>> On Feb 8, 2017, at 10:38 AM, Steve Christensen  wrote:
>> 
>> The time between when the request is made and when it completes with an 
>> error might be a minute or so, so the framework is immediately bailing on 
>> the request. I'm wondering what part of the process generates the error. 
>> Does the server return a non-200 status code or what?
> 
> The server is probably returning a redirect (301, 302 or 303) to a bogus URL.

NSURLErrorUnsupportedURL in a background session is specifically a complaint 
that the URL is neither http nor https. Perhaps the server redirected to 
something else?


> There’s a delegate method you can implement to see the redirected URL, which 
> could help you troubleshoot this. But it sounds like it’s the server’s fault.

The bad URL is also recorded in the NSError's userInfo dictionary as 
NSURLErrorFailingURLStringErrorKey.


-- 
Greg Parker gpar...@apple.com Runtime Wrangler



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: What generates NSURLErrorUnsupportedURL?

2017-02-08 Thread Jens Alfke

> On Feb 8, 2017, at 10:38 AM, Steve Christensen  wrote:
> 
> The time between when the request is made and when it completes with an error 
> might be a minute or so, so the framework is immediately bailing on the 
> request. I'm wondering what part of the process generates the error. Does the 
> server return a non-200 status code or what?

The server is probably returning a redirect (301, 302 or 303) to a bogus URL.
There’s a delegate method you can implement to see the redirected URL, which 
could help you troubleshoot this. But it sounds like it’s the server’s fault.

—Jens
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

What generates NSURLErrorUnsupportedURL?

2017-02-08 Thread Steve Christensen
I am occasionally seeing a NSURLErrorUnsupportedURL (unsupported URL) error 
being returned by download tasks on a background NSURLSession, on iOS. Before 
you ask, the URL (https://…) is properly formed, [NSURL URLWithString:] returns 
a non-nil URL, and as an extra manual check I did an online validation of the 
URL on a couple of different websites to see if I missed something.

The time between when the request is made and when it completes with an error 
might be a minute or so, so the framework is immediately bailing on the 
request. I'm wondering what part of the process generates the error. Does the 
server return a non-200 status code or what? Searching for more detail in the 
docs, etc., hasn't yielded anything except comments from people saying to make 
sure that the scheme is specified.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com