Skip to content

Conversation

@vas3a
Copy link
Collaborator

@vas3a vas3a commented Oct 22, 2025

No description provided.

} catch (e) {
this.logger.error(
`Failed to update payment processing state: ${e.message} for winnings '${winningsIds.join(',')}`,
`Failed to update payment processing state: ${e?.message} for winnings '${winningsIds.join(',')}`,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ correctness]
Using optional chaining (e?.message) is a good practice to avoid runtime errors if e is null or undefined. However, ensure that e is always an object in this context. If e can be a non-object type, consider adding a type guard or additional error handling to ensure that e.message is accessed safely.

status: 'FAILED',
});

await this.trolleyService.removePayment(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
Consider wrapping the removePayment call in a try-catch block to handle potential errors gracefully. If removePayment fails, it could leave the system in an inconsistent state, especially since an error is already being thrown immediately after.

@kkartunov kkartunov merged commit b41c474 into dev Oct 22, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants