Remove Change.handleError

This commit is contained in:
Candy 2016-05-06 13:26:58 -04:00
parent 1559db2ca3
commit 8ab6fccdea
2 changed files with 11 additions and 11 deletions

View File

@ -62,4 +62,14 @@ methods: {
}
```
Please see [related code change](https://github.com/strongloop/loopback/pull/2174) here.
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.

View File

@ -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);