Skip to content

[BUG]: No graceful error handling when WhatsApp connection fails or times out #43

Description

@simrannsv

Describe the bug
When the WhatsApp connection fails, drops, or times out,
the terminal displays a raw unformatted error or crashes
silently. There is no user-friendly error message to
inform the user what went wrong or how to recover.

Steps to Reproduce

  1. Start chat-buddy in the terminal
  2. Interrupt the WhatsApp connection (disconnect network,
    revoke WhatsApp Web session, or let it time out)
  3. Observe the terminal output

Expected Behavior
The application should:

  • Display a clear, friendly error message explaining
    what went wrong
  • Suggest a recovery action (e.g. "Run the command
    again to reconnect" or "Scan QR code to re-authenticate")
  • Exit gracefully without crashing or showing raw
    stack traces to the user

Actual Behavior
Raw error output or silent crash with no guidance
for the user on how to recover.

Impact
This affects every user whose WhatsApp session
expires or connection drops — which is a common
real-world scenario.

Suggested Fix
Add a try/catch wrapper around the WhatsApp
connection initialization with:

  • A descriptive error message
  • A clean exit or auto-reconnect prompt

Additional Context
Good error handling is critical for a terminal-based
tool where users have no GUI feedback. This would
significantly improve the user experience.

I would love to work on this fix under GSSoC '26.
Please assign this issue to me.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions