Errors are in some cases send as text and not JSON. The cli can look at the content type of the reply to determine the format.
Steps to reproduce:
Upload ipa with architecture that is not compatible with the device selection.
Result:
Error "Unexpected token N in JSON at position 0" occurred in deserializing the responseBody - "No valid devices in selection (fb9a78d3: 1 devices)" for the default response.
Expected result:
Error output with the following content:
No valid devices in selection (fb9a78d3: 1 devices)
Hi @john7doe , thanks for flagging this discrepancy out and letting us know. We've noted this down in our backlog. Currently we're working on other items in our public roadmap, and will get back when we have this.
Is this issue resolved or not? I'm still getting same error while uploading iOS app to appcenter.
Error: Error "Unexpected token N in JSON at position 0" occurred in deserializin
g the responseBody - "No valid devices in selection (e1439c1a: 1 devices)" for t
he default response.
We talked about this a bit in the test cloud team. The issue is that the swagger file in appcenter does not tell the truth entirely. on HTTP code 200 we return JSON alright, but on != 200 we return plaintext. The swagger declares that it is always JSON.
IOW: the fix is to update the server side swagger, then regenerate the client libs in this project.
(@prashantchoubey16 the issue is not fixed yet - sorry)
This issue is now fixed on the server-side, which should now be returning proper JSON in all error cases. @prashantchoubey16 /cc @glennwester
Awesome! Thanks @jacobe for the quick fix of this bug. @prashantchoubey16 could you try it out and let us know if you still have any issues?
Will close for now per @jacobe request. Thanks!
Most helpful comment
This issue is now fixed on the server-side, which should now be returning proper JSON in all error cases. @prashantchoubey16 /cc @glennwester