Skip to content

Commit

Permalink
Improve Google Tasks error messages (home-assistant#134023)
Browse files Browse the repository at this point in the history
  • Loading branch information
allenporter authored Dec 26, 2024
1 parent f7fe2f2 commit 45657ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions homeassistant/components/google_tasks/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ async def delete(
def response_handler(_, response, exception: HttpError) -> None:
if exception is not None:
raise GoogleTasksApiError(
f"Google Tasks API responded with error ({exception.status_code})"
f"Google Tasks API responded with error ({exception.reason or exception.status_code})"
) from exception
if response:
data = json.loads(response)
Expand Down Expand Up @@ -152,7 +152,7 @@ async def _execute(self, request: HttpRequest | BatchHttpRequest) -> Any:
result = await self._hass.async_add_executor_job(request.execute)
except HttpError as err:
raise GoogleTasksApiError(
f"Google Tasks API responded with error ({err.status_code})"
f"Google Tasks API responded with: {err.reason or err.status_code})"
) from err
if result:
_raise_if_error(result)
Expand Down

0 comments on commit 45657ec

Please sign in to comment.