Fix error handling and null pointer issues#20240
Fix error handling and null pointer issues#20240hobostay wants to merge 1 commit intoanomalyco:devfrom
Conversation
- Fix silent error handling in global/index.ts: log cache cleanup failures instead of swallowing them - Fix unsafe non-null assertion in provider.ts: check if create function exists before accessing - Add error handling to rpc.ts listen: handle JSON parse errors and unknown methods gracefully These changes improve robustness and provide better error messages for debugging. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found one potentially related PR: PR #11723: "fix: replace non-null assertions on find() with proper null checks"
The other results returned are PR #20240 itself (the current PR) and unrelated PRs about providers, memory leaks, and environment handling. Conclusion: While PR #11723 shares a similar theme (fixing non-null assertions), the searches indicate PR #20240 appears to be addressing unique issues in specific files ( No duplicate PRs found |
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
Summary
This PR fixes several error handling and null pointer issues that could cause silent failures or confusing runtime errors:
1. Silent error handling in
global/index.ts2. Unsafe non-null assertion in
provider/provider.ts!non-null assertion without checking iffind()returnedundefined3. Missing error handling in
util/rpc.tslisten()function had no error handling for JSON parse errors or unknown methodsTest Plan
Screenshots
N/A
🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com