vycheck() never throws synchronously. Failures arrive as a promise rejection, and every rejection today is a plain Error: read err.message, not a code.
VerifyYou: initialize failed (HTTP <status>). The session expired or was already used; mint a fresh one.
Dismissal is not an error
Closing a drawer or inline embed without finishing resolves with{ token: null, verified: false, vyc: null }. Check for a missing token; do not rely on catch.
Redirect mode never rejects after navigation
In redirect modevycheck() navigates the page away, so its promise never settles and nothing after it runs. Error handling for that path belongs on the return page, around vyget() and your own confirmation call.
VerifyYouError
The package exports a typed error class for transport failures. No code path throws it today, so do not branch oninstanceof VerifyYouError. It exists for forward compatibility; when it does fire, it is still an Error, so err.message handling keeps working.
init, vycheck, and vyget.