PayFanout API reference
    Preparing search index...

    Function localizeError

    • Localizes any UnifiedError/PayFanoutError for display: the locale's message for its code when one is registered (resolved per code — exact locale, then primary subtag, same chain as getUserMessage), otherwise the error's own (English, user-safe) message. For English (or no locale) the error's own message wins — it can be more specific than the generic catalog entry.

      Parameters

      • error: Pick<UnifiedError, "code" | "message">
      • Optionallocale: string

      Returns string