fix: replace 16 bare excepts with except Exception across 9 files#205
Open
haosenwang1018 wants to merge 1 commit intoHKUDS:mainfrom
Open
fix: replace 16 bare excepts with except Exception across 9 files#205haosenwang1018 wants to merge 1 commit intoHKUDS:mainfrom
haosenwang1018 wants to merge 1 commit intoHKUDS:mainfrom
Conversation
Bare `except:` catches BaseException including KeyboardInterrupt and SystemExit, which can mask critical errors and prevent clean shutdowns. This replaces 16 bare except clauses across 10 files with `except Exception:` to only catch non-system exceptions.
5834350 to
e8ef899
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace bare
except:withexcept Exception:across 9 files (16 sites).Why: Bare
except:catchesBaseExceptionincludingKeyboardInterruptandSystemExit, which can prevent clean shutdown and mask critical errors. Usingexcept Exception:preserves all existing fallback behavior while allowing system exceptions to propagate.Files changed:
scripts/generate_roster.py— pagination fallbackscripts/start_web.py— port check fallbacksrc/agents/research/agents/reporting_agent.py— citation parsing (2 sites)src/api/routers/knowledge.py— progress tracking (3 sites)src/api/utils/task_id_manager.py— task cleanupsrc/knowledge/start_kb.py— service startupsrc/logging/adapters/lightrag.py— logger setup (2 sites)src/logging/logger.py— log formatting (2 sites)src/tools/tex_downloader.py— file extraction (3 sites)