---
url: >-
  https://canary.warp-drive.io/api/@warp-drive/legacy/adapter/error/variables/ServerError.md
description: >-
  Legacy adapter error constructor for an HTTP 500 response, signaling that the
  API failed internally and an immediate retry is unlikely to succeed.
---

&#x20;

# &#x20;ServerError

```ts
ServerError: AdapterRequestErrorConstructor<ServerError>;
```

Defined in: [warp-drive-packages/legacy/src/adapter/error.ts:555](https://github.com/warp-drive-data/warp-drive/blob/48dc0d277b98008082669dadc6a52e5c5682ef8e/warp-drive-packages/legacy/src/adapter/error.ts#L555)

A `ServerError` equates to an HTTP `500 Internal Server Error` response
status. It is used by the adapter to indicate that a request has failed
because of an error in the external API, and is unlikely to succeed if
retried immediately.

An example use case would be to show a generic "something went wrong on
our end" message rather than one implying the user made a mistake:

```js [app/routes/application.js]
import { ServerError } from '@warp-drive/legacy/adapter/error';

export default class ApplicationRoute extends Route {
  @action
  error(error, transition) {
    if (error instanceof ServerError) {
      alert('Something went wrong on our end. Please try again later.');
      return;
    }

    // ...other error handling logic
  }
}
```
