> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# error • AI Agent SDK

> error: Emit error event.

# error

Method

> This is a method of the [**TraceEmitter**](https://praison.ai/docs/sdk/reference/praisonaiagents/classes/TraceEmitter.md) class in the [**protocol**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/protocol.md) module.

Emit error event.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def error(message: str, tool_name: Optional[str], agent_name: Optional[str], agent_id: Optional[str], metadata: Optional[Dict[str, Any]]) -> None
```

## Parameters

**message** `str` *required*

No description available.

**tool\_name** `Optional[str]`

No description available.

**agent\_name** `Optional[str]`

No description available.

**agent\_id** `Optional[str]`

No description available.

**metadata** `Optional`

No description available.

## Uses

* `ActionEvent`
* `time.time`

## Used By

* [`DeepResearchAgent.research`](../functions/DeepResearchAgent-research)
* [`DeepResearchAgent.aresearch`](../functions/DeepResearchAgent-aresearch)
* [`Handoff.execute_programmatic`](../functions/Handoff-execute_programmatic)
* [`Handoff.to_tool_function`](../functions/Handoff-to_tool_function)
* [`TypedHandoff.execute_programmatic`](../functions/TypedHandoff-execute_programmatic)

## Source

> [card] [View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/trace/protocol.py#L341)
>
> `praisonaiagents/trace/protocol.py` at line 341


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.