Skip to content

Conversation

@richardjrossiii
Copy link
Contributor

When unity has no network, it returns an empty string for 'error', which causes Int32.Parse to throw an exception.

Fixes #20.

cc @hallucinogen @grantland

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. At this point www will return an error and we should return one, otherwise we'll break ParseCommandRunner https://github.com/ParsePlatform/Parse-SDK-dotNET/blob/master/Parse/Internal/Command/ParseCommandRunner.cs#L43. 201 isn't really an error.

I always wonder why they can't parse the string. Maybe the string doesn't contain number at all, which means it's a client error. By default we should return 400 https://github.com/hungrylabs/hungry/blob/gogo.push-xamarin-ios/windows/Parse/Parse/PlatformHooks.Unity.cs#L678

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. My mistake, will update.

I'm actually pretty sure 'error' is a string like 'network unavailable', but I'm not 100% sure.

When unity has no network, it returns a string such as 'no network', which causes `Int32.Parse` to throw an exception. Fixes #20.
@hallucinogen
Copy link
Contributor

LGTM ship!

richardjrossiii added a commit that referenced this pull request Oct 1, 2015
…t.error Parse error codes from unity using TryParse, to prevent exceptions.
@richardjrossiii richardjrossiii merged commit bc9e948 into master Oct 1, 2015
@richardjrossiii richardjrossiii deleted the richardross.unity.httpclient.error branch October 1, 2015 22:15
@richardjrossiii richardjrossiii added this to the 1.6.1 milestone Oct 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

5 participants