Uh oh!
There was an error while loading. Please reload this page.
fix: replace bare except with specific exception types - #447
Conversation
Bare except catches KeyboardInterrupt and SystemExit, preventing normal program termination. Now only catches KeyError, TypeError, ValueError which are the actual exceptions StoreKey.__init__ may raise.
Summary by CodeRabbitBug Fixes
✏️ Tip: You can customize this high-level summary in your review settings. 概览修改异常处理逻辑,将宽泛的 变更
代码审查工作量估算🎯 2 (Simple) | ⏱️ ~8 分钟 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Pull request overview
This PR fixes a problematic bare except: clause by replacing it with specific exception types (KeyError, TypeError, ValueError). The bare except was catching all exceptions including KeyboardInterrupt and SystemExit, which prevented proper program termination.
Changes:
- Replaced bare
except:withexcept (KeyError, TypeError, ValueError):in thecreateContextfunction - Removed the
noqa: E722comment that was suppressing the linting warning
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
except:withexcept (KeyError, TypeError, ValueError):KeyboardInterruptandSystemExit, preventing normal program terminationStoreKey.__init__may actually raiseTest plan
KeyboardInterrupt(Ctrl+C) properly terminates the executor