Repository navigation
fix: add error logging to empty catch blocks in cleanup operations - #18240
huaiyuWangh wants to merge 1 commit into
Conversation
|
The following comment was made by an LLM, it may be inaccurate: |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
3a4e9e3 to
f1ecc29
Compare
Previously, several catch blocks silently ignored errors during cleanup operations (killing processes, destroying services), which could hide issues during development and debugging. Changes: - mcp/index.ts: Log when killing descendant MCP processes fails - pty/index.ts: Log when killing PTY processes fails (2 locations) - mdns.ts: Log when destroying bonjour instance fails These are debug-level logs since failures during cleanup are often expected (e.g., process already exited) but should still be visible for troubleshooting.
f1ecc29 to
10550e8
Compare
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Closes #18239
Type of change
What does this PR do?
This PR fixes empty catch blocks in cleanup operations that were silently hiding errors.
The problem: Several catch blocks were empty, making it impossible to debug when cleanup operations failed (e.g., killing processes, destroying services).
The fix: Added debug-level logging to 4 empty catch blocks:
packages/opencode/src/mcp/index.ts- Log when killing MCP descendant processes failspackages/opencode/src/pty/index.ts- Log when killing PTY processes fails (2 locations)packages/opencode/src/server/mdns.ts- Log when destroying bonjour instance failsWhy it works: These are cleanup operations where failures are often expected (e.g., process already exited). The debug logs don't change the error handling behavior - errors are still gracefully ignored - but now developers can see what's happening during troubleshooting.
How did you verify your code works?
Screenshots / recordings
Not applicable - this is a logging improvement with no UI changes.
Checklist