mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-22 19:07:54 +01:00
refactor: log event type when an event can't be saved (#1763)
* refactor: log event type when an event can't be saved * Update src/lib/db/event-store.ts Co-authored-by: Thomas Heartman <thomas@getunleash.ai> Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
This commit is contained in:
parent
5d5fc37dfd
commit
88dc83ed6f
@ -51,8 +51,8 @@ class EventStore extends EventEmitter implements IEventStore {
|
||||
.returning(EVENT_COLUMNS);
|
||||
const savedEvent = this.rowToEvent(rows[0]);
|
||||
process.nextTick(() => this.emit(event.type, savedEvent));
|
||||
} catch (e) {
|
||||
this.logger.warn(`Failed to store event ${e}`);
|
||||
} catch (error: unknown) {
|
||||
this.logger.warn(`Failed to store "${event.type}" event: ${error}`);
|
||||
}
|
||||
}
|
||||
|
||||
@ -65,8 +65,8 @@ class EventStore extends EventEmitter implements IEventStore {
|
||||
process.nextTick(() =>
|
||||
savedEvents.forEach((e) => this.emit(e.type, e)),
|
||||
);
|
||||
} catch (e) {
|
||||
this.logger.warn('Failed to store events');
|
||||
} catch (error: unknown) {
|
||||
this.logger.warn(`Failed to store events: ${error}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user