<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [server](./server.md) &gt; [ErrorHandler](./server.errorhandler.md) &gt; [error](./server.errorhandler.error.md)

## ErrorHandler.error() method

Logs a formatted error message with stack trace to help debug issues

**Signature:**

```typescript
static error(message: string, context?: string): void;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

message


</td><td>

string


</td><td>

The error message to display


</td></tr>
<tr><td>

context


</td><td>

string


</td><td>

_(Optional)_ Optional context information about the error


</td></tr>
</tbody></table>
**Returns:**

void

