Skip to content

Add describe() method to WraithError subclasses (#173) - #188

Merged
truthixify merged 2 commits into
wraith-protocol:developfrom
Jerryvic911:issue-173-describe-error-hints
Aug 27, 2026
Merged

Add describe() method to WraithError subclasses (#173)#188
truthixify merged 2 commits into
wraith-protocol:developfrom
Jerryvic911:issue-173-describe-error-hints

Conversation

@Jerryvic911

Copy link
Copy Markdown
Contributor

Closes #173

Summary

Adds an optional describe(): string method to the WraithError base
class with a generic fallback, overridden on all concrete subclasses
with a hint templated from this.context. Each hint includes 1-2
concrete 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: base describe() fallback + tailored overrides on
    every concrete subclass
  • test/errors.test.ts: test.each-based suite asserting describe()
    returns a non-empty, tailored hint (not the generic fallback) for
    every subclass
  • docs/errors.md: new "Actionable Fix Hints with describe()"
    section with a worked example

Notes

  • The issue mentions 18 concrete error classes; I only found 16 in
    src/errors.ts on develop. Happy to add more if any are missing
    elsewhere — let me know if I'm missing something.
  • No changes to .message or .toJSON() output — verified via the
    existing instanceof/JSON tests, which all still pass unmodified.
  • src/chains/stellar/errors.ts (Soroban contract error decoding) is
    a separate, unrelated system and wasn't touched.

Testing

pnpm exec vitest run test/errors.test.ts — 33/33 passing (17
existing + 16 new).

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.
@drips-wave

drips-wave Bot commented Aug 25, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@truthixify

Copy link
Copy Markdown
Contributor

Thanks @Jerryvic911. Same story as the run above: test (20) and test (22) fail on pnpm api:check, not on a test. Adding describe() to the error classes changes the public surface, so etc/sdk.api.md needs regenerating:

pnpm build
git add etc/
git commit -m "chore: refresh api-extractor baseline"
git push

The error work itself looks fine, all other jobs are green.

@truthixify
truthixify merged commit 41df156 into wraith-protocol:develop Aug 27, 2026
12 checks passed
@truthixify

Copy link
Copy Markdown
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.

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.

Error describe() helper with actionable fix hints

2 participants