# - [smarthome](https://developers.home.google.com/reference/local-home/modules/smarthome.html).
- [IntentFlow](https://developers.home.google.com/reference/local-home/modules/smarthome.intentflow.html).
- HandlerError

Use the `HandlerError` class to return an error status from your intent
handler code. Classes such as [DeviceManager](https://developers.home.google.com/reference/local-home/interfaces/smarthome.devicemanager.html) 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);
      }
      ...
    }

Errors returned by your app are visible in your cloud project logs.
For more details, see the error logging
[developer guide](https://developers.home.google.com/cloud-to-cloud/analytics/logging).

## Index

### Constructors

- [constructor](https://developers.home.google.com/reference/local-home/classes/smarthome.intentflow.handlererror#constructor)

### Properties

- [debugString](https://developers.home.google.com/reference/local-home/classes/smarthome.intentflow.handlererror#debugstring)
- [errorCode](https://developers.home.google.com/reference/local-home/classes/smarthome.intentflow.handlererror#errorcode)
- [message](https://developers.home.google.com/reference/local-home/classes/smarthome.intentflow.handlererror#message)
- [name](https://developers.home.google.com/reference/local-home/classes/smarthome.intentflow.handlererror#name)
- [requestId](https://developers.home.google.com/reference/local-home/classes/smarthome.intentflow.handlererror#requestid)
- [stack](https://developers.home.google.com/reference/local-home/classes/smarthome.intentflow.handlererror#stack)
- [Error](https://developers.home.google.com/reference/local-home/classes/smarthome.intentflow.handlererror#error)

## Constructors

### constructor

- new HandlerError ( requestId : string , errorCode ? : undefined \| string , debugString ? : undefined \| string ) : [HandlerError](https://developers.home.google.com/reference/local-home/classes/smarthome.intentflow.handlererror)
-

  #### Parameters

  -

    ##### requestId: string

    Request ID of the intent.
  -

    ##### Optional errorCode: undefined \| string

    The cause for this error. For more details on error
    codes, see [errors and
    exceptions](https://developers.home.google.com/cloud-to-cloud/intents/errors-exceptions).
  -

    ##### Optional debugString: undefined \| string

    Human readable description of this error

  #### Returns [HandlerError](https://developers.home.google.com/reference/local-home/classes/smarthome.intentflow.handlererror)

## Properties

### Optional debugString

debugString: undefined \| string Human readable description of this error

### errorCode

errorCode: string The cause for this error

### message

message: string Inherited from [HandlerError](https://developers.home.google.com/reference/local-home/classes/smarthome.intentflow.handlererror).[message](https://developers.home.google.com/reference/local-home/classes/smarthome.intentflow.handlererror#message)

### name

name: string Inherited from [HandlerError](https://developers.home.google.com/reference/local-home/classes/smarthome.intentflow.handlererror).[name](https://developers.home.google.com/reference/local-home/classes/smarthome.intentflow.handlererror#name)

### requestId

requestId: string Request ID from the associated `EXECUTE` intent.

### Optional stack

stack: undefined \| string Inherited from [HandlerError](https://developers.home.google.com/reference/local-home/classes/smarthome.intentflow.handlererror).[stack](https://developers.home.google.com/reference/local-home/classes/smarthome.intentflow.handlererror#stack)

### Static Error

Error: ErrorConstructor