The error that is thrown when a job times out

Hierarchy

  • HttpError
    • RetryTimeoutError

Constructors

  • Parameters

    • message: string
    • obstructions: {
          code: "Job Failed";
          text: string;
          data: {
              jobId: string;
              elapsedMs: number;
              numRetries: number;
          };
      }[]

    Returns RetryTimeoutError

Properties

prepareStackTrace?: ((err, stackTraces) => any)

Optional override for formatting stack traces

Type declaration

stackTraceLimit: number
status: 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 444 | 449 | 450 | 451 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 598 | 599
tag: "HttpError"

A tag identifying this object as an HttpError. Any object having this tag should implement this interface

name: "Bad Request" | "Unauthorized" | "Payment Required" | "Forbidden" | "Not Found" | "Method Not Allowed" | "Not Acceptable" | "Proxy Authentication Required" | "Request Timeout" | "Conflict" | "Gone" | "Length Required" | "Precondition Failed" | "Payload Too Large" | "URI Too Long" | "Unsupported Media Type" | "Range Not Satisfiable" | "Expectation Failed" | "I'm a teapot" | "Enhance Your Calm" | "Unprocessable Entity" | "Locked" | "Failed Dependency" | "Reserved for WebDAV" | "Upgrade Required" | "Precondition Required" | "Too Many Requests" | "Request Header Fields Too Large" | "No Response" | "Retry With" | "Blocked by Windows Parental Controls" | "Unavailable For Legal Reasons" | "Client Closed Request" | "Internal Server Error" | "Not Implemented" | "Bad Gateway" | "Service Unavailable" | "Gateway Timeout" | "HTTP Version Not Supported" | "Variant Also Negotiates" | "Insufficient Storage" | "Loop Detected" | "Bandwidth Limit Exceeded" | "Not Extended" | "Network Authentication Required" | "Network read timeout error" | "Network connect timeout error"

The name of the error, which will always be the official text associated with the status code

subcode?: string

An optional subcode that you can use to further understand why an error occurred.

logLevel: SimpleLogLevel

The level at which this error should be logged. This can be useful for keeping log noise down for unimportant errors such as 404s while elevating more important errors, such as "database down".

obstructions: {
    code: string;
    text: string;
}[]

An optional list of obstructions that can help the user understand why they can't do what they're trying to do

Type declaration

  • code: string
  • text: string
headers: Record<string, string>

Headers to attach to the HTTP response. Useful for things like attaching the WWW-Authenticate header to 401 responses.

cause?: unknown
message: string
stack?: string

Methods

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void

  • Create an HTTP error from a random error

    NOTE: If the passed-in error is already an HttpError, it will be passed back without modification. Any status or metadata passed in will not be applied in this case. Because of this, you can think of the status and meta params as defaults.

    Type Parameters

    • Status extends 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 444 | 449 | 450 | 451 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 598 | 599

    • Obstructions extends {
          code: string;
          text: string;
      } = {
          code: string;
          text: string;
      }

    Parameters

    Returns HttpError<Status, {
        code: string;
        text: string;
    }>

  • Type Parameters

    • Obstructions extends {
          code: string;
          text: string;
      } = {
          code: string;
          text: string;
      }

    Parameters

    Returns HttpError<400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 444 | 449 | 450 | 451 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 598 | 599, {
        code: string;
        text: string;
    }>

  • Serialize an HTTP error to JSON

    Returns HttpErrorJSON<400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 444 | 449 | 450 | 451 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 598 | 599, {
        code: string;
        text: string;
    }>

  • Create an HTTP error from a JSON representation

    Type Parameters

    • Status extends 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 444 | 449 | 450 | 451 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 598 | 599 = 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 444 | 449 | 450 | 451 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 598 | 599

    • Obstructions extends {
          code: string;
          text: string;
      } = {
          code: string;
          text: string;
      }

    Parameters

    Returns HttpError<Status, Obstructions>

Generated using TypeDoc