# Function: explainError()

> **explainError**(`error`, `context?`, `origin?`): [`ExplainedError`](../interfaces/ExplainedError.md)

Defined in: [dev/src/explain.ts:61](https://github.com/debuffjp/debuff/blob/4f0ae1091cc5ab837e28b1efc93d4aed7342f621/packages/dev/src/explain.ts#L61)

Explain an error from its stack: whose code threw, where to look, and what to try.
Heuristic but conservative: when unsure it says so instead of guessing.

## Parameters

### error

`unknown`

### context?

#### phase?

`string`

#### scene?

`string`

#### tick?

`number`

### origin?

`string` = `...`

## Returns

[`ExplainedError`](../interfaces/ExplainedError.md)
