Skip to content

feat: typed Command headers and default error codes#13

Merged
maxholman merged 3 commits intomasterfrom
feat/command-headers-and-error-codes
Apr 9, 2026
Merged

feat: typed Command headers and default error codes#13
maxholman merged 3 commits intomasterfrom
feat/command-headers-and-error-codes

Conversation

@maxholman
Copy link
Copy Markdown
Contributor

Summary

  • Add 4th generic CommandHeaders to Command with public readonly headers property and optional constructor arg
  • RestServiceClient.response() merges command.headers into fetch request headers (client → command → runtime priority)
  • Set default error codes: ServiceError/ServiceResponseErrorUNAVAILABLE, PublicValibotHonoErrorINVALID_ARGUMENT
  • Fully backward compatible — commands without headers unchanged

Test plan

  • All 16 existing tests pass
  • No breaking changes to existing Command subclasses

🤖 Generated with Claude Code

maxholman and others added 3 commits April 9, 2026 17:32
ServiceError/ServiceResponseError default to UNAVAILABLE,
PublicValibotHonoError defaults to INVALID_ARGUMENT.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add 4th generic CommandHeaders to Command with a public readonly
headers property and optional constructor arg. RestServiceClient
merges command.headers into the fetch request between client-level
and runtime headers.

Fully backward compatible — commands without headers are unchanged.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@maxholman maxholman merged commit e4aed4e into master Apr 9, 2026
1 check passed
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