Callback<TResult>: ((error?, result?) => void)

NodeJS-style callback parameter for the Handler type. Can be used instead of returning a promise, see the AWS documentation for the handler programming model.

Type Parameters

  • TResult = any

Type declaration

    • (error?, result?): void
    • Parameters

      • Optional error: Error | string | null

        Parameter to use to provide the error payload for a failed lambda execution. See AWS documentation for error handling. If an Error instance is passed, the error payload uses the name property as the errorType, the message property as the errorMessage, and parses the stack property string into the trace array. For other values, the errorType is typeof value, the errorMessage is String(value), and trace is an empty array.

      • Optional result: TResult

        Parameter to use to provide the result payload for a successful lambda execution. Pass null or undefined for the error parameter to use this parameter.

      Returns void