-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hassio cleanup part2 #12588
Hassio cleanup part2 #12588
Conversation
data = yield from funct(*argv, **kwargs) | ||
if data and data['result'] == "ok": | ||
return data['data'] | ||
return None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this make you lose what's inside data if result != ok ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes: https://github.com/home-assistant/hassio/blob/dev/API.md#hassio-restful-api there is only a data on 'ok'. On 'error' there is a message. Maybe we can log this message if available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be great. I am not a fan of silent errors. I prefer raising.
Description: