docs(sdk/js): document YiviSessionError class - #37
Merged
Conversation
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
rubenhensen
approved these changes
May 2, 2026
5 tasks
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 #35.
Documents the
YiviSessionErrorclass exported from@e4a/pg-js(added in postguard-js#37, merged 2026-05-01).Changes
docs/sdk/js-errors.md: newYiviSessionErrorsection withreason/cancelledproperties, aninstanceofexample, and source link pinned toerrors.tsat the currentmainHEAD. Added the class to the error hierarchy and to the handling-order guidance.docs/sdk/js-encryption.md: error-handling section listsYiviSessionErrorand 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
src/errors.ts#L48-L59at2e2e0442a23b9f821a2bca008fe270af6c487e30.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