Skip to content

Commit

Permalink
chore: log id when errors
Browse files Browse the repository at this point in the history
  • Loading branch information
anxolin committed Feb 14, 2024
1 parent eba2318 commit feb3b64
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/domain/polling/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,15 @@ export async function checkForAndPlaceOrder(
(isError && pollResult.reason ? `. Reason: ${pollResult.reason}` : "");

log[unexpectedError ? "error" : "info"](
`Check conditional order result: ${getEmojiByPollResult(
pollResult?.result
)} ${resultDescription}`
`Check conditional order result for ${
conditionalOrder.id
}: ${getEmojiByPollResult(pollResult?.result)} ${resultDescription}`
);
if (unexpectedError) {
log.error(`UNEXPECTED_ERROR Details:`, pollResult.error);
log.error(
`UNEXPECTED_ERROR for order ${conditionalOrder.id}. Details:`,
pollResult.error
);
}

hasErrors ||= unexpectedError;
Expand All @@ -217,7 +220,9 @@ export async function checkForAndPlaceOrder(
const deleted = conditionalOrders.delete(conditionalOrder);
const action = deleted ? "Stop Watching" : "Failed to stop watching";

log.debug(`${action} conditional order from TX ${conditionalOrder.tx}`);
log.debug(
`${action} conditional order ${conditionalOrder.id} from TX ${conditionalOrder.tx}`
);
metrics.activeOrdersTotal.labels(chainId.toString()).dec();
}
}
Expand Down

0 comments on commit feb3b64

Please sign in to comment.