Skip to content

Commit

Permalink
refactor: err logging
Browse files Browse the repository at this point in the history
  • Loading branch information
fearandesire committed Nov 10, 2024
1 parent 66d7ce0 commit 1edef0a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/interaction-handlers/ButtonListener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,13 @@ export class ButtonHandler extends InteractionHandler {
const prop = await propsApi.getPropById(payload.propId);

if (!prop) {
console.error({
method: this.constructor.name,
message: 'Prop not found',
data: {
propId: payload.propId,
},
});
throw new Error('Prop not found');
}

Expand Down Expand Up @@ -281,6 +288,13 @@ export class ButtonHandler extends InteractionHandler {
}, 10000);
}
} catch (error: unknown) {
console.error({
method: this.constructor.name,
message: 'Error occured regarding predictions',
data: {
error,
},
});
// ? NOTE: Embed titles may say 'Prediction Error' - but since this is catch-all scope, it could be prop related as well.
return new ApiErrorHandler().handle(
interaction,
Expand Down

0 comments on commit 1edef0a

Please sign in to comment.