# How to customize Ember Data error messages

**URL:** <https://discuss.emberjs.com/t/how-to-customize-ember-data-error-messages/11810>\
**Category:** Ember Data\
**Created:** [October 22, 2016, 9:34am UTC](https://discuss.emberjs.com/t/how-to-customize-ember-data-error-messages/11810 "2016-10-22T09:34:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaaksarv](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@jaaksarv](https://discuss.emberjs.com/u/jaaksarv)\
**Post date:** [October 22, 2016, 9:34am UTC](https://discuss.emberjs.com/t/how-to-customize-ember-data-error-messages/11810/1 "2016-10-22T09:34:48Z")

</div>

How can I customize/translate Ember Data generic error messages “Adapter operation failed”. Validation errors I have already translated on server side, but sometimes something unexpected happens (HTTP 500, network error etc). How can I customize those default error messages?

---

<div class="post-metadata">

**Author:** ![jaaksarv](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@jaaksarv](https://discuss.emberjs.com/u/jaaksarv)\
**Post date:** [October 25, 2016, 11:57am UTC](https://discuss.emberjs.com/t/how-to-customize-ember-data-error-messages/11810/2 "2016-10-25T11:57:49Z")

</div>

Any ideas how to solve this?

---

<div class="post-metadata">

**Author:** ![matheos](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@matheos](https://discuss.emberjs.com/u/matheos)\
**Post date:** [October 25, 2016, 1:15pm UTC](https://discuss.emberjs.com/t/how-to-customize-ember-data-error-messages/11810/3 "2016-10-25T13:15:54Z")

</div>

You can override the handResponse() function in your adapter.

> **[RESTAdapter - 4.6 - Ember API Documentation](https://api.emberjs.com/ember-data/release/classes/RESTAdapter)**
>
> The REST adapter allows your store to communicate with an HTTP server by transmitting JSON via XHR. Most Ember.js apps that consume a JSON API should use the REST adapter. This adapter is designed around the idea that the JSON exchanged with the...

E.g.

```
handleResponse (status, headers, payload, requestData) {
  if (status === 500) {
    return new Error("My custom error 500 message");
  }

  return payload;
}

```
