Skip to content

docs(sdk/js): document YiviSessionError class - #37

Merged
rubenhensen merged 1 commit into
mainfrom
docs/yivi-session-error
May 2, 2026
Merged

docs(sdk/js): document YiviSessionError class#37
rubenhensen merged 1 commit into
mainfrom
docs/yivi-session-error

Conversation

@dobby-coder

@dobby-coder dobby-coder Bot commented May 2, 2026

Copy link
Copy Markdown
Contributor

Closes #35.

Documents the YiviSessionError class exported from @e4a/pg-js (added in postguard-js#37, merged 2026-05-01).

Changes

  • docs/sdk/js-errors.md: new YiviSessionError section with reason / cancelled properties, an instanceof example, and source link pinned to errors.ts at the current main HEAD. Added the class to the error hierarchy and to the handling-order guidance.
  • docs/sdk/js-encryption.md: error-handling section lists YiviSessionError and shows a try/catch branching on it for the Yivi sign flow.
  • docs/sdk/js-decryption.md: same, for the Yivi open flow — reader can show a friendly cancelled/timed-out message instead of a generic decryption failure.

Verification

  • Snippet line range matches the source file: src/errors.ts#L48-L59 at 2e2e0442a23b9f821a2bca008fe270af6c487e30.
  • npm run docs:build — completes in ~5s, no errors.

Reviewer quickstart

git fetch origin && git checkout docs/yivi-session-error && npm install && npm run docs:dev

Adds YiviSessionError to the js-errors reference (with reason and
cancelled fields, an instanceof example, and the relevant entry in the
error hierarchy). Updates the error-handling sections of js-encryption
and js-decryption to show how to branch on YiviSessionError to surface
a friendly cancelled/timed-out message.

Closes #35
@dobby-coder
dobby-coder Bot requested a review from rubenhensen May 2, 2026 10:30
@dobby-coder
dobby-coder Bot marked this pull request as ready for review May 2, 2026 10:31
@rubenhensen
rubenhensen merged commit daac969 into main May 2, 2026
1 check passed
@dobby-coder
dobby-coder Bot deleted the docs/yivi-session-error branch May 2, 2026 20:02
@dobby-coder dobby-coder Bot mentioned this pull request Jun 27, 2026
5 tasks
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.

docs(sdk/js): document new exported YiviSessionError class

1 participant