particle-iot / cloud

A place to discuss issues, enhancements, features for: API, Cloud Compiler, Web IDE (Build), Webhooks, Console, and Device Setup
2 stars 0 forks source link

No error message when claiming a device owned by someone else #7

Closed monkbroc closed 8 years ago

monkbroc commented 8 years ago

Bugs

Expected behavior

When claiming a device owned by someone else, previously the API would return as part of the errors JSON array the string "That belongs to someone else". The CLI used that to show the prompt to request a transfer.

Observed behavior

When the device ID is owned by the current user, or is invalid, a 404 response with this body is returned

{ ok: false, errors: [ {} ] }

This causes the CLI to say Failed to claim device, server said: [object Object] since errors contains an empty object instead of a string.

Steps to reproduce

particle device add 11111111111111111111111

brycekahle commented 8 years ago

The 404 might be because 11111111111111111111111 is not a valid device id? Can you try with a device id you know exists but belongs to someone else?

brycekahle commented 8 years ago

Ok. Confirmed this is an issue. Looking into a fix now