Skip to content
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

Add raise_for_status in cloudhook #165

Merged
merged 1 commit into from
Jun 16, 2020
Merged

Add raise_for_status in cloudhook #165

merged 1 commit into from
Jun 16, 2020

Conversation

balloob
Copy link
Member

@balloob balloob commented Jun 11, 2020

Only HTTP call we had that didn't check status.

@@ -41,6 +41,7 @@ async def async_create(self, webhook_id: str, managed: bool) -> Dict[str, Any]:
with async_timeout.timeout(10):
resp = await cloud_api.async_create_cloudhook(self.cloud)

resp.raise_for_status()
Copy link
Member

Choose a reason for hiding this comment

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

I think we should raise a own Exception, catch that on HA and make a better error handling with a nice message. Now we replace the exception from json with the exception from aiohttp.

Copy link
Member Author

Choose a reason for hiding this comment

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

Let's do that in another PR. For now we should at least raise. Currently you get a key error because it treats it as valid data.

@balloob balloob merged commit f405e1f into master Jun 16, 2020
@balloob balloob deleted the raise-for-status branch June 16, 2020 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants