bothy-sdk
    Preparing search index...

    Function problemError

    • Builds the typed error of a failed answer.

      Parameters

      • status: number

        The HTTP status.

      • body: unknown

        The decoded body; anything that is not a problem object (an HTML page of a proxy, an empty body) gives the code unknown and the class of the status.

      • options: { operation?: string; retryAfterMs?: number } = {}

        retryAfterMs of Retry-After and the operation for the message.

      Returns ProblemError

      The error, not thrown.

      problemError(404, undefined, { operation: "getRun" }).message; // "getRun: 404 unknown"