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

    Function errorText

    • The texts for an error in the closest shipped locale to locale (BCP 47, default: the browser's language, else English). Given a WebSignError, {installed} and {required} are filled from its details.

      Returns undefined for codes a site never shows people (InvalidRequest, PinIncorrect, ClientOutdated: bugs or internal) and for undefined, so errorText(status.problem) just works.

      Parameters

      Returns ErrorText | undefined

      import { errorText } from "@websign/sdk/messages";

      catch (error) {
      if (!isWebSignError(error) || error.code === "UserCancelled") return;
      const text = errorText(error, document.documentElement.lang);
      if (text) showBanner(text.title, text.body);
      }