diff --git a/packages/ember-data/lib/adapters/errors.js b/packages/ember-data/lib/adapters/errors.js index 0ef53e630f7..df8cb6954dc 100644 --- a/packages/ember-data/lib/adapters/errors.js +++ b/packages/ember-data/lib/adapters/errors.js @@ -12,7 +12,7 @@ export function AdapterError(errors, message = 'Adapter operation failed') { this.errors = errors || [ { title: 'Adapter Error', - details: message + detail: message } ]; } @@ -56,11 +56,11 @@ AdapterError.prototype = Object.create(EmberError.prototype); // Fictional adapter that always rejects return Ember.RSVP.reject(new DS.InvalidError([ { - details: 'Must be unique', + detail: 'Must be unique', source: { pointer: 'data/attributes/title' } }, { - details: 'Must not be blank', + detail: 'Must not be blank', source: { pointer: 'data/attributes/content'} } ])); @@ -119,7 +119,7 @@ export function errorsHashToArray(errors) { for (let i = 0; i < messages.length; i++) { out.push({ title: 'Invalid Attribute', - details: messages[i], + detail: messages[i], source: { pointer: `data/attributes/${key}` } @@ -142,7 +142,7 @@ export function errorsArrayToHash(errors) { if (key) { key = key[2]; out[key] = out[key] || []; - out[key].push(error.details || error.title); + out[key].push(error.detail || error.title); } } }); diff --git a/packages/ember-data/lib/adapters/rest-adapter.js b/packages/ember-data/lib/adapters/rest-adapter.js index d8784f4b02b..b030ef633b6 100644 --- a/packages/ember-data/lib/adapters/rest-adapter.js +++ b/packages/ember-data/lib/adapters/rest-adapter.js @@ -889,7 +889,7 @@ var RESTAdapter = Adapter.extend(BuildURLMixin, { { status: `${status}`, title: "The backend responded with an error", - details: `${payload}` + detail: `${payload}` } ]; } diff --git a/packages/ember-data/tests/integration/adapter/rest-adapter-test.js b/packages/ember-data/tests/integration/adapter/rest-adapter-test.js index eb4e97f896c..30b46b6df77 100644 --- a/packages/ember-data/tests/integration/adapter/rest-adapter-test.js +++ b/packages/ember-data/tests/integration/adapter/rest-adapter-test.js @@ -1885,7 +1885,7 @@ test('on error wraps the error string in an DS.AdapterError object', function() try { run(function() { store.find('post', '1').catch(function(err) { - equal(err.errors[0].details, errorThrown); + equal(err.errors[0].detail, errorThrown); ok(err, 'promise rejected'); }); }); diff --git a/packages/ember-data/tests/integration/serializers/json-serializer-test.js b/packages/ember-data/tests/integration/serializers/json-serializer-test.js index 86a31611f2c..3a11c5336e7 100644 --- a/packages/ember-data/tests/integration/serializers/json-serializer-test.js +++ b/packages/ember-data/tests/integration/serializers/json-serializer-test.js @@ -566,11 +566,11 @@ test('extractErrors respects custom key mappings', function() { errors: [ { source: { pointer: 'data/attributes/le_title' }, - details: "title errors" + detail: "title errors" }, { source: { pointer: 'data/attributes/my_comments' }, - details: "comments errors" + detail: "comments errors" } ] }; @@ -591,7 +591,7 @@ test('extractErrors expects error information located on the errors property of errors: [ { source: { pointer: 'data/attributes/title' }, - details: "title errors" + detail: "title errors" } ] }; diff --git a/packages/ember-data/tests/unit/adapter-errors-test.js b/packages/ember-data/tests/unit/adapter-errors-test.js index 7c98b92779f..396a21353c9 100644 --- a/packages/ember-data/tests/unit/adapter-errors-test.js +++ b/packages/ember-data/tests/unit/adapter-errors-test.js @@ -32,17 +32,17 @@ var errorsHash = { var errorsArray = [ { title: 'Invalid Attribute', - details: 'is invalid', + detail: 'is invalid', source: { pointer: 'data/attributes/name' } }, { title: 'Invalid Attribute', - details: 'must be a string', + detail: 'must be a string', source: { pointer: 'data/attributes/name' } }, { title: 'Invalid Attribute', - details: 'must be a number', + detail: 'must be a number', source: { pointer: 'data/attributes/age' } } ]; @@ -67,7 +67,7 @@ test("DS.InvalidError will normalize errors hash with deprecation", function() { deepEqual(error.errors, [ { title: 'Invalid Attribute', - details: 'is invalid', + detail: 'is invalid', source: { pointer: 'data/attributes/name' } } ]);