From 8ab6fccdea03c6bd7c2a12e2d526099581cf5bdc Mon Sep 17 00:00:00 2001 From: Candy Date: Fri, 6 May 2016 13:26:58 -0400 Subject: [PATCH] Remove Change.handleError --- 3.0-RELEASE-NOTES.md | 12 +++++++++++- common/models/change.js | 10 ---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/3.0-RELEASE-NOTES.md b/3.0-RELEASE-NOTES.md index f70b1185..7c287c3e 100644 --- a/3.0-RELEASE-NOTES.md +++ b/3.0-RELEASE-NOTES.md @@ -62,4 +62,14 @@ methods: { } ``` -Please see [related code change](https://github.com/strongloop/loopback/pull/2174) here. \ No newline at end of file +Please see [related code change](https://github.com/strongloop/loopback/pull/2174) here. + +## remove `Change.handleError` +`Change.handleError` is now removed as it was used inconsistenly for a subset of possible +errors only. All Change methods will report all errors to the caller via the callback. + +Use PersistedModel to report change-tracking errors via the existing method +PersistedModel.handleChangeError. This method can be customized on a per-model basis to +provide different error handling. + +Please see [related code change](https://github.com/strongloop/loopback/pull/2308) here. diff --git a/common/models/change.js b/common/models/change.js index d647f2be..767cdcd6 100644 --- a/common/models/change.js +++ b/common/models/change.js @@ -15,7 +15,6 @@ var CJSON = { stringify: require('canonical-json') }; var async = require('async'); var assert = require('assert'); var debug = require('debug')('loopback:change'); -var deprecate = require('depd')('loopback'); /** * Change list entry. @@ -507,15 +506,6 @@ module.exports = function(Change) { return checkpointModel; }; - Change.handleError = function(err) { - deprecate('Change.handleError is deprecated, ' + - 'you should pass errors to your callback instead.'); - - if (!this.settings.ignoreErrors) { - throw err; - } - }; - Change.prototype.debug = function() { if (debug.enabled) { var args = Array.prototype.slice.call(arguments);