Skip to content

Surface real runtime errors instead of "Unknown error"#46

Closed
sean808080 wants to merge 1 commit intomoazbuilds:masterfrom
sean808080:codex/pr-surface-real-runtime-errors
Closed

Surface real runtime errors instead of "Unknown error"#46
sean808080 wants to merge 1 commit intomoazbuilds:masterfrom
sean808080:codex/pr-surface-real-runtime-errors

Conversation

@sean808080
Copy link
Copy Markdown

Summary

When Claude returns useful error text on stdout, the current forwarding paths can drop it and show Unknown error instead.

This change improves error extraction for daemon forwarding, Telegram, and Discord by:

  • preferring stderr when present
  • extracting structured JSON error messages when stdout is a Claude error envelope
  • falling back to plain-text stdout when that contains the real message

Why

This preserves actionable runtime failures like Prompt is too long and auth errors, instead of collapsing them into a generic placeholder.

Validation

  • bun x tsc --noEmit

christian-drescher added a commit to christian-drescher/claudeclaw that referenced this pull request Mar 20, 2026
@sean808080
Copy link
Copy Markdown
Author

Closing in favour of #58 which takes a better approach: rather than patching a single call site, PR #58 introduces a shared src/messaging.ts utility module with an extractErrorDetail() function that handles the JSON stdout parsing in one place, then updates all three chat bridges (start.ts, telegram.ts, discord.ts) to use it. Same bug fixed, no duplication.

@sean808080 sean808080 closed this Mar 24, 2026
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