Skip to content

feat: improve debug logging and error handling - #2

Open
imneov wants to merge 1 commit into
mainfrom
feat/improve-debug-and-error-handling
Open

feat: improve debug logging and error handling#2
imneov wants to merge 1 commit into
mainfrom
feat/improve-debug-and-error-handling

Conversation

@imneov

@imneov imneov commented Dec 17, 2025

Copy link
Copy Markdown

Summary

Added comprehensive debugging capabilities and improved error messages to help diagnose issues more effectively.

Changes

Server Improvements (server/claude-sdk.js)

Debug Logging:

  • Added detailed debug logs for incoming options
  • Log mapped SDK options for troubleshooting
  • Added stderr capture for Claude CLI output
  • Better visibility into SDK initialization

Error Handling:

  • Improved error messages with actionable hints
  • Special handling for common error patterns:
    • API 400 errors: Suggests starting new session
    • Process exit errors: Explains potential causes
  • Added error hints to help users resolve issues quickly

Vite Configuration (vite.config.js)

Development Server:

  • Added allowedHosts configuration
  • Enables access through claudeui.a2d2.dev domain
  • Useful for testing with custom domain setup

Benefits

  1. Easier Debugging: Console logs show exactly what options are being passed
  2. Better User Experience: Clear error messages with actionable hints
  3. Faster Issue Resolution: Detailed logs help identify problems quickly
  4. Domain Support: Can access dev server through custom domain

Test Plan

  • Check console logs when making API requests
  • Verify error messages are helpful when errors occur
  • Test access through claudeui.a2d2.dev domain
  • Verify stderr messages are captured correctly

🤖 Generated with Claude Code

Added comprehensive debugging and better error messages:

Server improvements (server/claude-sdk.js):
- Added detailed debug logs for SDK options mapping
- Improved error messages with specific hints for common issues
- Added stderr capture for better error diagnostics
- Provide actionable hints for API errors and session corruption

Vite config (vite.config.js):
- Added allowedHosts configuration for claudeui.a2d2.dev domain
- Enables access through custom domain in development

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant