Agent: Fix exception handling for failed delivery of agent events

If there's an exception while sending the event to the island it should be logged as exception, not warning (events are not being stored, that's a big no-no). Also, the log should contain proper information of stack trace, not event type
This commit is contained in:
vakaris_zilius 2022-09-30 09:54:12 +00:00 committed by Kekoa Kaaikala
parent 3d27e42ff3
commit 550c375abc
1 changed files with 2 additions and 2 deletions

View File

@ -79,8 +79,8 @@ class BatchingAgentEventForwarder:
try:
logger.debug(f"Sending Agent events to Island: {events}")
self._island_api_client.send_events(events)
except Exception as err:
logger.warning(f"Exception caught when connecting to the Island: {err}")
except Exception:
logger.exception("Exception caught when connecting to the Island")
def _send_remaining_events(self):
self._send_events_to_island()