---
url: "https://vueda.dev/v3/reference/api/js/utils/formatError/functions/formatError.md"
title: "formatError"
---

# formatError

## Overview

Format an error object for display. In development, we include the stack trace and if available, the
 server stack trace.

## Signature

`formatError(error)`

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| <span id="param-error">error</span> | `Error \| FetchError \| Error \| FetchError[]` | yes | the error object to format |

### Returns

`string`

- the formatted error message

## Source

`client/lib/utils/formatError.js:18`
