Skip to content

Commit

Permalink
Remove Change.handleError
Browse files Browse the repository at this point in the history
  • Loading branch information
0candy committed May 6, 2016
1 parent 1559db2 commit 31390f6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 11 additions & 1 deletion 3.0-RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

## removing `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.
10 changes: 0 additions & 10 deletions common/models/change.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 31390f6

Please sign in to comment.