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 Reolink unexpected error translation #134807

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions homeassistant/components/reolink/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@
"timeout": {
"message": "Timeout waiting on a response: {err}"
},
"unexpected": {
"message": "Unexpected Reolink error: {err}"
},
"firmware_install_error": {
"message": "Error trying to update Reolink firmware: {err}"
},
Expand Down
6 changes: 5 additions & 1 deletion homeassistant/components/reolink/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ async def decorator_raise_translated_error(*args: P.args, **kwargs: P.kwargs) ->
translation_placeholders={"err": str(err)},
) from err
except ReolinkError as err:
raise HomeAssistantError(err) from err
raise HomeAssistantError(
translation_domain=DOMAIN,
translation_key="unexpected",
translation_placeholders={"err": str(err)},
) from err

return decorator_raise_translated_error
Loading