function InvalidError(errors) {
  if (!Ember.isArray(errors)) {
    Ember.deprecate('`InvalidError` expects json-api formatted errors.');
    errors = errorsHashToArray(errors);
  }
  AdapterError.call(this, errors, 'The adapter rejected the commit because it was invalid');
}
/**
  A `DS.InvalidError` is used by an adapter to signal the external API
  was unable to process a request because the content was not
  semantically correct or meaningful per the API. Usually this means a
  record failed some form of server side validation. When a promise
  from an adapter is rejected with a `DS.InvalidError` the record will
  transition to the `invalid` state and the errors will be set to the
  `errors` property on the record.

  For Ember Data to correctly map errors to their corresponding
  properties on the model, Ember Data expects each error to be
  a valid json-api error object with a `source/pointer` that matches
  the property name. For example if you had a Post model that
  looked like this.

  ```app/models/post.js
  import DS from 'ember-data';

  export default DS.Model.extend({
    title: DS.attr('string'),
    content: DS.attr('string')
  });
  ```

  To show an error from the server related to the `title` and
  `content` properties your adapter could return a promise that
  rejects with a `DS.InvalidError` object that looks like this:

  ```app/adapters/post.js
  import Ember from 'ember';
  import DS from 'ember-data';

  export default DS.RESTAdapter.extend({
    updateRecord: function() {
      // Fictional adapter that always rejects
      return Ember.RSVP.reject(new DS.InvalidError([
        {
          detail: 'Must be unique',
          source: { pointer: 'data/attributes/title' }
        },
        {
          detail: 'Must not be blank',
          source: { pointer: 'data/attributes/content'}
        }
      ]));
    }
  });
  ```

  Your backend may use different property names for your records the
  store will attempt extract and normalize the errors using the
  serializer's `extractErrors` method before the errors get added to
  the the model. As a result, it is safe for the `InvalidError` to
  wrap the error payload unaltered.

  @class InvalidError
  @namespace DS
*/
A `DS.InvalidError` is used by an adapter to signal the external API
was unable to process a request because the content was not
semantically correct or meaningful per the API. Usually this means a
record failed some form of server side validation.

For Ember Data to correctly map errors to their corresponding
properties on the model, Ember Data expects each error to be
a valid json-api error object with a `source/pointer` that matches
the property name. For example if you had a Post model that
looked like this.

```app/models/post.js
import DS from 'ember-data'.





```app/adapters/post.js
import Ember from 'ember';
import DS from 'ember-data'.



Your backend may use different property names for your records the
store will attempt extract and normalize the errors using the
serializer's `extractErrors` method before the errors get added to
the the model. As a result, it is safe for the `InvalidError` to
wrap the error payload unaltered.
A ` DS . InvalidError ` is used by an adapter to signal the external API was unable to process a request because the content was not semantically correct or meaningful per the API . Usually this means a record failed some form of server side validation . For Ember Data to correctly map errors to their corresponding properties on the model Ember Data expects each error to be a valid json - api error object with a ` source / pointer ` that matches the property name . For example if you had a Post model that looked like this . ` ` ` app / models / post . js import DS from ' ember - data ' . ` ` ` app / adapters / post . js import Ember from ' ember ' ; import DS from ' ember - data ' . Your backend may use different property names for your records the store will attempt extract and normalize the errors using the serializer ' s ` extractErrors ` method before the errors get added to the the model . As a result it is safe for the ` InvalidError ` to wrap the error payload unaltered .
function InvalidError(errors) {
  if (!Ember.isArray(errors)) {
    Ember.deprecate('`InvalidError` expects json-api formatted errors.');
    errors = errorsHashToArray(errors);
  }
  AdapterError.call(this, errors, 'The adapter rejected the commit because it was invalid');
}
function InvalidError ( errors ) { if ( ! Ember . isArray ( errors ) ) { Ember . deprecate ( '`InvalidError` expects json-api formatted errors.' ) ; errors = errorsHashToArray ( errors ) ; } AdapterError . call ( this , errors , 'The adapter rejected the commit because it was invalid' ) ; }
A `DS.InvalidError` is used by an adapter to signal the external API
was unable to process a request because the content was not
semantically correct or meaningful per the API.
A ` DS . InvalidError ` is used by an adapter to signal the external API was unable to process a request because the content was not semantically correct or meaningful per the API .