dist/globals/ember-data.prod.js in ember-data-source-2.15.1 vs dist/globals/ember-data.prod.js in ember-data-source-2.15.2

- old
+ new

@@ -4,11 +4,11 @@ /*! * @overview Ember Data * @copyright Copyright 2011-2017 Tilde Inc. and contributors. * Portions Copyright 2011 LivingSocial Inc. * @license Licensed under MIT license (see license.js) - * @version 2.15.1 + * @version 2.15.2 */ var loader, define, requireModule, require, requirejs; (function (global) { @@ -818,11 +818,11 @@ var camelized = _ember.default.String.camelize(modelName); return _ember.default.String.pluralize(camelized); } }); }); -define('ember-data/-private/adapters/errors', ['exports', 'ember', 'ember-data/-private/features'], function (exports, _ember, _features) { +define('ember-data/-private/adapters/errors', ['exports', 'ember'], function (exports, _ember) { 'use strict'; exports.__esModule = true; exports.ServerError = exports.ConflictError = exports.NotFoundError = exports.ForbiddenError = exports.UnauthorizedError = exports.AbortError = exports.TimeoutError = exports.InvalidError = undefined; exports.AdapterError = AdapterError; @@ -913,15 +913,10 @@ title: 'Adapter Error', detail: message }]; } - var extendedErrorsEnabled = false; - if (true) { - extendedErrorsEnabled = true; - } - function extendFn(ErrorClass) { return function () { var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, defaultMessage = _ref.message; @@ -934,23 +929,18 @@ (false && _ember.default.assert('`AdapterError` expects json-api formatted errors array.', Array.isArray(errors || []))); ParentErrorClass.call(this, errors, message || defaultMessage); }; ErrorClass.prototype = Object.create(ParentErrorClass.prototype); + ErrorClass.extend = extendFn(ErrorClass); - if (extendedErrorsEnabled) { - ErrorClass.extend = extendFn(ErrorClass); - } - return ErrorClass; } AdapterError.prototype = Object.create(EmberError.prototype); - if (extendedErrorsEnabled) { - AdapterError.extend = extendFn(AdapterError); - } + AdapterError.extend = extendFn(AdapterError); /** 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 @@ -1086,11 +1076,11 @@ ``` @class UnauthorizedError @namespace DS */ - var UnauthorizedError = exports.UnauthorizedError = extendedErrorsEnabled ? extend(AdapterError, 'The adapter operation is unauthorized') : null; + var UnauthorizedError = exports.UnauthorizedError = extend(AdapterError, 'The adapter operation is unauthorized'); /** A `DS.ForbiddenError` equates to a HTTP `403 Forbidden` response status. It is used by an adapter to signal that a request to the external API was valid but the server is refusing to respond to it. If authorization was @@ -1098,11 +1088,11 @@ necessary permissions for the request. @class ForbiddenError @namespace DS */ - var ForbiddenError = exports.ForbiddenError = extendedErrorsEnabled ? extend(AdapterError, 'The adapter operation is forbidden') : null; + var ForbiddenError = exports.ForbiddenError = extend(AdapterError, 'The adapter operation is forbidden'); /** A `DS.NotFoundError` equates to a HTTP `404 Not Found` response status. It is used by an adapter to signal that a request to the external API was rejected because the resource could not be found on the API. @@ -1136,11 +1126,11 @@ ``` @class NotFoundError @namespace DS */ - var NotFoundError = exports.NotFoundError = extendedErrorsEnabled ? extend(AdapterError, 'The adapter could not find the resource') : null; + var NotFoundError = exports.NotFoundError = extend(AdapterError, 'The adapter could not find the resource'); /** A `DS.ConflictError` equates to a HTTP `409 Conflict` response status. It is used by an adapter to indicate that the request could not be processed because of a conflict in the request. An example scenario would be when @@ -1148,21 +1138,21 @@ to the external API. @class ConflictError @namespace DS */ - var ConflictError = exports.ConflictError = extendedErrorsEnabled ? extend(AdapterError, 'The adapter operation failed due to a conflict') : null; + var ConflictError = exports.ConflictError = extend(AdapterError, 'The adapter operation failed due to a conflict'); /** A `DS.ServerError` equates to a 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. @class ServerError @namespace DS */ - var ServerError = exports.ServerError = extendedErrorsEnabled ? extend(AdapterError, 'The adapter operation failed due to a server error') : null; + var ServerError = exports.ServerError = extend(AdapterError, 'The adapter operation failed due to a server error'); /** Convert an hash of errors into an array with errors in JSON-API format. ```javascript @@ -14785,25 +14775,23 @@ } var errors = this.normalizeErrorResponse(status, headers, payload); var detailedMessage = this.generatedDetailedMessage(status, headers, payload, requestData); - if ((0, _private.isEnabled)('ds-extended-errors')) { - switch (status) { - case 401: - return new _private.UnauthorizedError(errors, detailedMessage); - case 403: - return new _private.ForbiddenError(errors, detailedMessage); - case 404: - return new _private.NotFoundError(errors, detailedMessage); - case 409: - return new _private.ConflictError(errors, detailedMessage); - default: - if (status >= 500) { - return new _private.ServerError(errors, detailedMessage); - } - } + switch (status) { + case 401: + return new _private.UnauthorizedError(errors, detailedMessage); + case 403: + return new _private.ForbiddenError(errors, detailedMessage); + case 404: + return new _private.NotFoundError(errors, detailedMessage); + case 409: + return new _private.ConflictError(errors, detailedMessage); + default: + if (status >= 500) { + return new _private.ServerError(errors, detailedMessage); + } } return new _private.AdapterError(errors, detailedMessage); }, isSuccess: function (status, headers, payload) { @@ -15397,17 +15385,15 @@ _private.DS.AdapterError = _private.AdapterError; _private.DS.InvalidError = _private.InvalidError; _private.DS.TimeoutError = _private.TimeoutError; _private.DS.AbortError = _private.AbortError; - if ((0, _private.isEnabled)('ds-extended-errors')) { - _private.DS.UnauthorizedError = _private.UnauthorizedError; - _private.DS.ForbiddenError = _private.ForbiddenError; - _private.DS.NotFoundError = _private.NotFoundError; - _private.DS.ConflictError = _private.ConflictError; - _private.DS.ServerError = _private.ServerError; - } + _private.DS.UnauthorizedError = _private.UnauthorizedError; + _private.DS.ForbiddenError = _private.ForbiddenError; + _private.DS.NotFoundError = _private.NotFoundError; + _private.DS.ConflictError = _private.ConflictError; + _private.DS.ServerError = _private.ServerError; _private.DS.errorsHashToArray = _private.errorsHashToArray; _private.DS.errorsArrayToHash = _private.errorsArrayToHash; _private.DS.Serializer = _serializer.default; @@ -18423,10 +18409,10 @@ }); define("ember-data/version", ["exports"], function (exports) { "use strict"; exports.__esModule = true; - exports.default = "2.15.1"; + exports.default = "2.15.2"; }); define("ember-inflector", ["module", "exports", "ember", "ember-inflector/lib/system", "ember-inflector/lib/ext/string"], function (module, exports, _ember, _system) { "use strict"; exports.__esModule = true;