CatchAll: Repository-Aware Exception Handling with Knowledge-Guided LLMs
Qingxiao Tao, Xiaodong Gu, Hao Zhong, Beijun Shen

TL;DR
CatchAll is a novel LLM-based approach that enhances exception handling in code by integrating API, repository context, and cross-project knowledge, leading to more accurate and context-aware error recovery.
Contribution
The paper introduces CatchAll, a repository-aware exception handling method that combines multiple knowledge layers to improve LLM performance in real-world codebases.
Findings
Outperforms state-of-the-art baselines in code generation metrics.
Achieves higher intent prediction accuracy.
Demonstrates effectiveness on new benchmark datasets.
Abstract
Exception handling is a vital forward error-recovery mechanism in many programming languages, enabling developers to manage runtime anomalies through structured constructs (e.g., try-catch blocks). Improper or missing exception handling often leads to severe consequences, including system crashes and resource leaks. While large language models (LLMs) have demonstrated strong capabilities in code generation, they struggle with exception handling at the repository level, due to complex dependencies and contextual constraints. In this work, we propose CatchAll, a novel LLM-based approach for repository-aware exception handling. CatchAll equips LLMs with three complementary layers of exception-handling knowledge: (1) API-level exception knowledge, obtained from an empirically constructed API-exception mapping that characterizes the exception-throwing behaviors of APIs in real-world…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Software Testing and Debugging Techniques · Software System Performance and Reliability
