Skip to content

Commit

Permalink
🥅 server: add call context to cryptomate tx errors
Browse files Browse the repository at this point in the history
  • Loading branch information
cruzdanilo committed Oct 23, 2024
1 parent 9acdb2b commit 211a157
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/hooks/cryptomate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export default new Hono().post(
],
}).errorName;
} catch {} // eslint-disable-line no-empty
captureException(new Error(error), { contexts: { tx: { trace } } });
captureException(new Error(error), { contexts: { tx: { call, trace } } });
return c.json({ response_code: "69" });
}
if (
Expand All @@ -200,12 +200,12 @@ export default new Hono().post(
) !== amount
) {
debug(`${payload.event_type}:${payload.status}`, payload.operation_id, "bad collection");
captureException(new Error("bad collection"), { level: "warning", contexts: { tx: { trace } } });
captureException(new Error("bad collection"), { level: "warning", contexts: { tx: { call, trace } } });
return c.json({ response_code: "51" });
}
return c.json({ response_code: "00" });
} catch (error: unknown) {
captureException(error);
captureException(error, { contexts: { tx: { call } } });
return c.json({ response_code: "05" });
}
case "CLEARING":
Expand Down

0 comments on commit 211a157

Please sign in to comment.