fix: replace bare except with except Exception (PEP 8 E722)#2049
fix: replace bare except with except Exception (PEP 8 E722)#2049harshadkhetpal wants to merge 3 commits intorobusta-dev:masterfrom
Conversation
|
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughThese changes narrow exception handlers in three utility methods from catching all thrown values to only catching Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes 🚥 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 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
Replace bare
except:clauses withexcept Exception:in three files:src/robusta/core/sinks/transformer.pysrc/robusta/integrations/prometheus/models.pysrc/robusta/core/sinks/robusta/prometheus_discovery_utils.pyBare
except:catches all exceptions includingSystemExit,KeyboardInterrupt, andGeneratorExit, which can mask critical errors and make debugging harder. Usingexcept Exception:is the PEP 8 recommended practice (E722) and preserves the ability to interrupt the program.Change:
Testing
No behavior change for normal exception handling — this is a correctness/style fix that only affects the handling of
BaseExceptionsubclasses likeKeyboardInterrupt.