---
url: "https://vueda.dev/v3/reference/api/js/utils/errors/FetchError/methods/constructor.md"
title: "constructor"
---

# constructor

## Overview

Creates an instance of FetchError.

## Signature

`constructor(messagePrefix, response, responseData)`

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| <span id="param-messagePrefix">messagePrefix</span> | `string` | yes | The prefix for the error message. |
| <span id="param-response">response</span> | `Response` | no | The response object associated with the error. |
| <span id="param-responseData">responseData</span> | `any` | no | The data returned in the response. |

### Returns

[FetchError](/v3/reference/api/js/utils/errors/members/FetchError.md)

## Source

`client/lib/utils/errors.js:45`
