-
Notifications
You must be signed in to change notification settings - Fork 1
fix: handle errors #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: handle errors #116
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughThe changes introduce improved error handling and robustness to the message processing flow in the Telegram app's main module. A new helper function, Changes
Sequence Diagram(s)sequenceDiagram
participant Consumer as Message Consumer
participant Parser as parseNewMessage
participant Handler as onNewMessage
participant Subscriptions as Subscription Service
participant Logger as Logger
Consumer->>Parser: parseNewMessage(msg)
alt Parsing fails
Parser->>Logger: Log parsing error
Parser-->>Consumer: return null
Consumer-->>Logger: Log processing skipped
else Parsing succeeds
Parser-->>Handler: Notification
Handler->>Subscriptions: Fetch subscriptions
alt Fetch fails
Subscriptions-->>Logger: Log fetch error
Handler-->>Consumer: return null
else No subscriptions
Handler-->>Logger: Log no subscriptions
else Subscriptions found
Handler->>...: Process notification
end
end
Poem
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
| onNewMessage(channel, msg); | ||
| onNewMessage(channel, msg).catch((error) => | ||
| console.error('Error processing queue message', error) | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the key part. Not throw if message is wrong
This PR handles the error that's making crashlooping in prod. We just crash if the queue message has not the right format
Also, prints some useful info on which part throws an error
Summary by CodeRabbit
Bug Fixes
Chores