Skip to content

Fix downloader_download_failed event not firing for HTTP response errors#24640

Merged
balloob merged 1 commit into
home-assistant:devfrom
sfjes:downloader_event_fix
Jun 20, 2019
Merged

Fix downloader_download_failed event not firing for HTTP response errors#24640
balloob merged 1 commit into
home-assistant:devfrom
sfjes:downloader_event_fix

Conversation

@sfjes
Copy link
Copy Markdown
Contributor

@sfjes sfjes commented Jun 20, 2019

Description:

Fix downloader_download_failed event not firing for HTTP response errors

The Downloader component documentation at https://www.home-assistant.io/components/downloader/ says:

In case download failed another event ‘downloader_download_failed’ is emitted to indicate that the download did not complete successfully.

However currently the event is only fired if there's a ConnectionError exception, and not if the download fails due to a non-200 HTTP response code. Only a warning is logged. According to the docs, this case should also fire a downloader_download_failed event. This PR adds that event.

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the [development checklist][dev-checklist]

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

@sfjes
Copy link
Copy Markdown
Contributor Author

sfjes commented Jun 20, 2019

I associated the commit email with my GitHub user. Let me know if additional steps are necessary.

@balloob balloob merged commit 0bdbf00 into home-assistant:dev Jun 20, 2019
@balloob
Copy link
Copy Markdown
Member

balloob commented Jun 20, 2019

Thanks!

@balloob balloob mentioned this pull request Jul 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants