---
title: RequestError
framework: mapkitjs
role: symbol
role_heading: Class
path: mapkitjs/requesterror
---

# RequestError

The error that a service method’s returned promise rejects with when a request fails.

## Declaration

```data
class RequestError extends Error
```

## Mentioned in

Migrating from Version 5 to Version 6

## Discussion

Discussion When a Service method’s returned promise rejects, the rejection value is a RequestError. The message property contains a ConfigurationErrorStatus value that describes the error. const search = new mapkit.Search();

try {     const data = await search.search("coffee"); } catch (error) {     if (error.message === "Too Many Requests") {         // Handle rate limiting.     } }

## Topics

### Properties

- [message](mapkitjs/requesterror/message.md)

## Relationships

### Inherits From

- Error

## See Also

### Service

- [Service](mapkitjs/service.md)
