Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

Commit

Permalink
log exceptions correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
edenhaus committed Jul 15, 2021
1 parent fea9c83 commit 340adbd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions deebotozmo/ecovacs_mqtt.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import json
import logging
import ssl
from typing import MutableMapping

from gmqtt import Client
from gmqtt.mqtt.constants import MQTTv311
from typing import MutableMapping

from deebotozmo.models import Vacuum, RequestAuth
from deebotozmo.vacuum_bot import VacuumBot
Expand Down Expand Up @@ -46,7 +47,7 @@ async def _on_message(client, topic: str, payload: bytes, qos, properties) -> in
await bot.handle(topic_split[2], data, False)
return _ON_MESSAGE_RETURN_SUCCESS
except Exception as err:
_LOGGER.error("An exception occurred", err)
_LOGGER.error("An exception occurred", err, exc_info=True)

self._client.on_message = _on_message
self._client.set_auth_credentials(auth.user_id, auth.token)
Expand Down
2 changes: 1 addition & 1 deletion deebotozmo/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ async def _handle_cached_map_info(self, event_data: dict, requested: bool):
if requested:
await self._execute_command(GetMapSet(map_id))
except Exception as e:
_LOGGER.debug("[_handle_cached_map] Exception thrown", e)
_LOGGER.debug("[_handle_cached_map] Exception thrown", e, exc_info=True)
_LOGGER.warning("[_handle_cached_map] MapID not found -- did you finish your first auto cleaning?")

async def _handle_map_set(self, event_data: dict, requested: bool):
Expand Down
2 changes: 1 addition & 1 deletion deebotozmo/vacuum_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ async def _handle_battery(self, event_data: dict):
try:
self.batteryEvents.notify(BatteryEvent(event_data["value"]))
except ValueError:
_LOGGER.warning(f"couldn't parse battery status: {event_data}")
_LOGGER.warning(f"Couldn't parse battery status: {event_data}")

async def _handle_charge_state_requested(self, event_body: dict):
if event_body["code"] == 0:
Expand Down

0 comments on commit 340adbd

Please sign in to comment.