From 26e696a090bae96c33e31521dcc307eae9bea1dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gast=C3=B3n=20Fournier?= Date: Mon, 18 Mar 2024 17:11:36 +0100 Subject: [PATCH] chore: log error properly (#6596) ## About the changes We see some logs with: `Failed to store events: Error: The query is empty` which suggests we're not sending events to batchStore. This will help us confirm that and will give us better insights --- src/lib/features/events/event-store.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/features/events/event-store.ts b/src/lib/features/events/event-store.ts index c0a477f841..9a330a60b9 100644 --- a/src/lib/features/events/event-store.ts +++ b/src/lib/features/events/event-store.ts @@ -158,7 +158,10 @@ class EventStore implements IEventStore { try { await this.db(TABLE).insert(events.map(this.eventToDbRow)); } catch (error: unknown) { - this.logger.warn(`Failed to store events: ${error}`); + this.logger.warn( + `Failed to store events: ${JSON.stringify(events)}`, + error, + ); } }