fix: surface 422 validation error messages from HEY API - #365
Open
AruneshDwivedi wants to merge 1 commit into
Open
fix: surface 422 validation error messages from HEY API#365AruneshDwivedi wants to merge 1 commit into
AruneshDwivedi wants to merge 1 commit into
Conversation
Depend on hey-sdk fork with fix-422-body branch to surface specific validation error messages instead of generic 'validation error' on hey draft send failures. Fixes basecamp#350.
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the HEY SDK dependency to surface specific 422 draft validation errors.
Changes:
- Redirects the SDK dependency to a fork containing draft error parsing.
- Currently introduces an invalid
go.moddirective and lacks regression coverage.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Suppressed comments (1)
go.mod:13
- The dependency change alters user-visible draft edit/send failures, but no command-level regression test serves a JSON 422 and asserts that its
errorstext reaches the CLI. Add cases for bothUpdateDraftandSendDraftto the existing draft lifecycle tests so a future SDK update cannot silently restore the generic message.
replace github.com/basecamp/hey-sdk/go => github.com/AruneshDwivedi/hey-sdk/go 7f51159f3c83
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| github.com/basecamp/actioncable-go v0.0.0-20260824145920-822e6cf08655 | ||
| github.com/basecamp/hey-sdk/go v0.28.1 | ||
|
|
||
| replace github.com/basecamp/hey-sdk/go => github.com/AruneshDwivedi/hey-sdk/go 7f51159f3c83 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When receives a 422 from HEY, the error message was always the generic "validation error" instead of the specific reasons from the response body. This made it impossible to diagnose why a draft failed to send.
Root cause: the hey-sdk and methods did not parse the JSON422 response body before calling , which returns a hardcoded "validation error" string for any 422.
Fix: parse and return the specific error messages joined together.
This required changes to the hey-sdk dependency. See fork at AruneshDwivedi/hey-sdk with commits:
The SDK changes are necessary because the generated client already parses JSON422 into the response struct, but the service wrapper discarded it.
Summary by cubic
Surfaces the specific validation error messages from HEY's 422 responses so draft send failures now show the actual reason instead of a generic "validation error".
Dependencies
replacedirective pointinggithub.com/basecamp/hey-sdk/goat a fork that parses 422 response bodies inUpdateDraftandSendDraft.replacedirective once the fix lands in the upstream SDK.Written for commit 1aa7065. Summary will update on new commits.