Skip to content

Commit c6c952a

Browse files
authored
chore: log unhandled errors (#511)
* chore: log unhandled errors * Update src/api.ts
1 parent 051608a commit c6c952a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/api.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ router.post(
2424
try {
2525
const result = await typedData(req);
2626
res.json(result);
27-
} catch (e) {
28-
log.warn(`[ingestor] msg validation failed (typed data): ${JSON.stringify(e)}`);
27+
} catch (e: any) {
28+
const errorMessage = typeof e === 'object' ? e.message || JSON.stringify(e) : String(e);
29+
log.warn(`[ingestor] msg validation failed (typed data): ${errorMessage}`);
2930
sendError(res, e);
3031
}
3132

0 commit comments

Comments
 (0)