Add describe() method to WraithError subclasses (#173) - #188
Merged
truthixify merged 2 commits intoAug 27, 2026
Merged
Conversation
Adds an optional describe(): string to the WraithError base class with a generic fallback, overridden on all 16 concrete subclasses with a hint templated from context, including 1-2 concrete next steps and the docs anchor. No changes to .message or .toJSON() output. Adds a describe() test per subclass and documents the pattern in docs/errors.md.
|
@Jerryvic911 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
|
Thanks @Jerryvic911. Same story as the run above: The error work itself looks fine, all other jobs are green. |
Contributor
|
Merged. Quick turnaround on the baseline @Jerryvic911, and a hint per error subclass rather than one generic string is what makes this actually useful in a console. |
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.
Closes #173
Summary
Adds an optional
describe(): stringmethod to theWraithErrorbaseclass with a generic fallback, overridden on all concrete subclasses
with a hint templated from
this.context. Each hint includes 1-2concrete next steps plus the docs anchor, so console output and error
toasts can surface useful guidance without a docs round-trip.
Changes
src/errors.ts: basedescribe()fallback + tailored overrides onevery concrete subclass
test/errors.test.ts:test.each-based suite assertingdescribe()returns a non-empty, tailored hint (not the generic fallback) for
every subclass
docs/errors.md: new "Actionable Fix Hints withdescribe()"section with a worked example
Notes
src/errors.tsondevelop. Happy to add more if any are missingelsewhere — let me know if I'm missing something.
.messageor.toJSON()output — verified via theexisting instanceof/JSON tests, which all still pass unmodified.
src/chains/stellar/errors.ts(Soroban contract error decoding) isa separate, unrelated system and wasn't touched.
Testing
pnpm exec vitest run test/errors.test.ts— 33/33 passing (17existing + 16 new).