> Documentation index: https://www.gooddata.ai/docs/gooddata-ui/llms.txt lists every page of these docs as Markdown.

# commandFailedEventHandler()

- Package: [@gooddata/sdk-ui-dashboard](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/index.md)
- Kind: function
- Stability: alpha
- Source: https://github.com/gooddata/gooddata-ui-sdk/blob/rel/11.64/libs/sdk-ui-dashboard/src/model/eventHandlers/eventHandler.ts

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

Creates a [DashboardEventHandler](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.dashboardeventhandler/index.md) instance that will be invoked for a DashboardCommandFailed of a particular command.

**Signature:**

```typescript
export declare function commandFailedEventHandler<TCommand extends IDashboardCommand>(type: TCommand["type"], handler: DashboardEventHandler<IDashboardCommandFailed<TCommand>>["handler"]): DashboardEventHandler<IDashboardCommandFailed<TCommand>>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| type | TCommand["type"] | the type of command the DashboardCommandFailed of which this handler should trigger for |
| handler | [DashboardEventHandler](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.dashboardeventhandler/index.md)&lt;[IDashboardCommandFailed](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.idashboardcommandfailed/index.md)&lt;TCommand&gt;&gt;["handler"] | the actual event handling function |

**Returns:**

[DashboardEventHandler](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.dashboardeventhandler/index.md)&lt;[IDashboardCommandFailed](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.idashboardcommandfailed/index.md)&lt;TCommand&gt;&gt;
