Neutrome SDK reference
    Preparing search index...

    Function parseProviderError

    • Parses a provider error body into a program carrying an error block.

      Parameters

      • style: ProviderStyle

        Wire format the body is written in.

      • body: Uint8Array

        Raw error body, as received from the provider.

      • meta: ProviderErrorMeta = {}

        Transport details used when the body is unparseable.

      Returns Program

      A program carrying the decoded error.

      const program = parseProviderError("chat-completions", body, { status: 429 });
      const error = getFirstErrorBlock(program);