mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-11 00:08:30 +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);
|
.returning(EVENT_COLUMNS);
|
||||||
const savedEvent = this.rowToEvent(rows[0]);
|
const savedEvent = this.rowToEvent(rows[0]);
|
||||||
process.nextTick(() => this.emit(event.type, savedEvent));
|
process.nextTick(() => this.emit(event.type, savedEvent));
|
||||||
} catch (e) {
|
} catch (error: unknown) {
|
||||||
this.logger.warn(`Failed to store event ${e}`);
|
this.logger.warn(`Failed to store "${event.type}" event: ${error}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,8 +65,8 @@ class EventStore extends EventEmitter implements IEventStore {
|
|||||||
process.nextTick(() =>
|
process.nextTick(() =>
|
||||||
savedEvents.forEach((e) => this.emit(e.type, e)),
|
savedEvents.forEach((e) => this.emit(e.type, e)),
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (error: unknown) {
|
||||||
this.logger.warn('Failed to store events');
|
this.logger.warn(`Failed to store events: ${error}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user