Remove Change.handleError
This commit is contained in:
parent
1559db2ca3
commit
8ab6fccdea
|
@ -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.
|
||||||
|
|
|
@ -15,7 +15,6 @@ var CJSON = { stringify: require('canonical-json') };
|
||||||
var async = require('async');
|
var async = require('async');
|
||||||
var assert = require('assert');
|
var assert = require('assert');
|
||||||
var debug = require('debug')('loopback:change');
|
var debug = require('debug')('loopback:change');
|
||||||
var deprecate = require('depd')('loopback');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Change list entry.
|
* Change list entry.
|
||||||
|
@ -507,15 +506,6 @@ module.exports = function(Change) {
|
||||||
return checkpointModel;
|
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() {
|
Change.prototype.debug = function() {
|
||||||
if (debug.enabled) {
|
if (debug.enabled) {
|
||||||
var args = Array.prototype.slice.call(arguments);
|
var args = Array.prototype.slice.call(arguments);
|
||||||
|
|
Loading…
Reference in New Issue