@websign/sdk - v0.1.0
    Preparing search index...

    Class WebSignError

    A failed SDK call. Every promise of the SDK rejects with one, never with anything else.

    • code is stable: switch on it.
    • message says what happened, hint what to do next; both are English, for developers, and never contain personal data.
    • docsUrl explains the code on the project site.
    • For the person, show errorText(error, locale) from @websign/sdk/messages: localized title and next step.
    try {
    await sign({ hash: "SHA-256", prepare });
    } catch (error) {
    if (!(error instanceof WebSignError)) throw error;
    if (error.code === "UserCancelled") return; // nothing to show
    console.warn(`${error.code}: ${error.message} ${error.hint} ${error.docsUrl}`);
    }

    Hierarchy

    • Error
      • WebSignError
    Index
    name: "WebSignError"
    hint: string

    What to do next, for the developer. People get errorText() instead.

    docsUrl: string

    The code's section on the project site (a stable anchor).

    code: ErrorCode

    Stable reason; one of the protocol catalog.

    details?: ErrorDetails

    Versions for the *Outdated codes, the native status for DriverFailure.

    cause?: unknown
    message: string
    stack?: string