hotfix: improve LNbits error handling and filter empty telebot errors#60
hotfix: improve LNbits error handling and filter empty telebot errors#60helloscoopa merged 1 commit intomainfrom
Conversation
- Add parseLNbitsError helper for robust error extraction (captures HTTP status, raw body, alternate message fields) - Filter empty/ghost telebot errors (code:0, empty message) in OnError handler and ErrorLogger - Add null-safe ctx checks in OnError to prevent panics - Add /health endpoint for monitoring Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThe PR enhances error handling across LNbits integration and Telegram error logging. It introduces a helper function to parse LNbits HTTP errors consistently with status codes and response bodies, extends the Error struct to capture additional context, improves Telegram error filtering to skip empty/ghost errors with nil-safety checks, and adds a health check endpoint to the API server. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Summary
parseLNbitsErrorhelper for robust error extraction (captures HTTP status code, raw body, and alternate message fields) — replaces boilerplate across 8 call sites{"message":"","Err":{},"code":0}) from OnError handler and ErrorLoggerctxchecks in OnError to prevent panics when context is nil/healthendpoint for monitoringWhat's NOT included
This is a targeted hotfix extracted from the dev branch. It deliberately excludes:
Test plan
/healthendpoint returns 200 OK🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
New Features