Use the HandlerError class to return an error status from your intent handler code. Classes such as DeviceManager return an instance of HandlerError when an error occurs. For other errors that may occur in your app, you can create a new instance and return a rejected Promise.

identifyHandler(request: IntentFlow.IdentifyRequest):
    Promise<IntentFlow.IdentifyResponse> {
  const scanData = request.inputs[0].payload.device.udpScanData;
  if (!scanData) {
    const err = new IntentFlow.HandlerError(request.requestId,
        ErrorCode.INVALID_REQUEST, 'Scan data not found');
    return Promise.reject(err);
  }
  ...
}

Index

Constructors

constructor

  • new HandlerError(requestId: string, errorCode: string, debugString?: undefined | string): HandlerError
  • Parameters

    • requestId: string

      Request ID from the associated EXECUTE intent.

    • errorCode: string

      The cause for this error

    • Optional debugString: undefined | string

      Human readable description of this error

    Returns HandlerError

Properties

Optional debugString

debugString: undefined | string

Human readable description of this error

errorCode

errorCode: string

The cause for this error

message

message: string

name

name: string

requestId

requestId: string

Request ID from the associated EXECUTE intent.

Optional stack

stack: undefined | string

Static Error

Error: ErrorConstructor