SQS Consumer
    Preparing search index...

    Class SQSError

    Hierarchy

    • Error
      • SQSError
    Index

    Constructors

    Properties

    code: string
    fault: "server" | "client"
    message: string
    name: string
    retryable: boolean
    service: string
    statusCode: number
    time: Date
    messageIds?: string[]
    metadata?: {
        attempts?: number;
        cfId?: string;
        extendedRequestId?: string;
        httpStatusCode?: number;
        requestId?: string;
        totalRetryDelay?: number;
    }

    Type declaration

    • Optional Readonlyattempts?: number

      The number of times this operation was attempted.

    • Optional ReadonlycfId?: string

      A tertiary identifier for the last request sent. Used for debugging.

    • Optional ReadonlyextendedRequestId?: string

      A secondary identifier for the last request sent. Used for debugging.

    • Optional ReadonlyhttpStatusCode?: number

      The status code of the last HTTP response received for this operation.

    • Optional ReadonlyrequestId?: string

      A unique identifier for the last request sent for this operation. Often requested by AWS service teams to aid in debugging.

    • Optional ReadonlytotalRetryDelay?: number

      The total amount of time (in milliseconds) that was spent waiting between retry attempts.

    queueUrl?: string
    response?: { headers: Record<string, string>; body?: any; statusCode?: number }

    Type declaration

    • headers: Record<string, string>

      The headers of the HTTP message.

    • Optionalbody?: any

      The body of the HTTP message. Can be: ArrayBuffer | ArrayBufferView | string | Uint8Array | Readable | ReadableStream

    • OptionalstatusCode?: number

      The status code of the HTTP response.

    stack?: string
    stackTraceLimit: number

    The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

    The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

    If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

    Methods

    • Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

      const myObject = {};
      Error.captureStackTrace(myObject);
      myObject.stack; // Similar to `new Error().stack`

      The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

      The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

      The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

      function a() {
      b();
      }

      function b() {
      c();
      }

      function c() {
      // Create an error without stack trace to avoid calculating the stack trace twice.
      const { stackTraceLimit } = Error;
      Error.stackTraceLimit = 0;
      const error = new Error();
      Error.stackTraceLimit = stackTraceLimit;

      // Capture the stack trace above function b
      Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
      throw error;
      }

      a();

      Parameters

      • targetObject: object
      • OptionalconstructorOpt: Function

      Returns void