3
3
Object . defineProperty ( exports , "__esModule" , {
4
4
value : true
5
5
} ) ;
6
- exports . PatchError = undefined ;
6
+ exports . RollbackError = undefined ;
7
7
8
8
exports . default = function ( schema , opts ) {
9
9
var options = ( 0 , _lodash . merge ) ( { } , defaultOptions , opts ) ;
@@ -38,7 +38,7 @@ exports.default = function (schema, opts) {
38
38
return new _bluebird2 . default ( function ( resolve , reject ) {
39
39
// patch doesn't exist
40
40
if ( ! ~ ( 0 , _lodash . map ) ( patches , 'id' ) . indexOf ( patchId ) ) {
41
- return reject ( new PatchError ( 'patch doesn\'t exist' ) ) ;
41
+ return reject ( new RollbackError ( 'patch doesn\'t exist' ) ) ;
42
42
}
43
43
44
44
// get all patches that should be applied
@@ -49,7 +49,7 @@ exports.default = function (schema, opts) {
49
49
// if the patches that are going to be applied are all existing patches,
50
50
// the rollback attempts to rollback to the latest patch
51
51
if ( patches . length === apply . length ) {
52
- return reject ( new PatchError ( 'rollback to latest patch' ) ) ;
52
+ return reject ( new RollbackError ( 'rollback to latest patch' ) ) ;
53
53
}
54
54
55
55
// apply patches to `state`
@@ -173,21 +173,21 @@ function _extendableBuiltin(cls) {
173
173
return ExtendableBuiltin ;
174
174
}
175
175
176
- var PatchError = exports . PatchError = function ( _extendableBuiltin2 ) {
177
- _inherits ( PatchError , _extendableBuiltin2 ) ;
176
+ var RollbackError = exports . RollbackError = function ( _extendableBuiltin2 ) {
177
+ _inherits ( RollbackError , _extendableBuiltin2 ) ;
178
178
179
- function PatchError ( message ) {
180
- _classCallCheck ( this , PatchError ) ;
179
+ function RollbackError ( message ) {
180
+ _classCallCheck ( this , RollbackError ) ;
181
181
182
- var _this = _possibleConstructorReturn ( this , Object . getPrototypeOf ( PatchError ) . call ( this ) ) ;
182
+ var _this = _possibleConstructorReturn ( this , Object . getPrototypeOf ( RollbackError ) . call ( this ) ) ;
183
183
184
184
Error . captureStackTrace ( _this , _this . constructor ) ;
185
185
_this . name = _this . constructor . name ;
186
186
_this . message = message ;
187
187
return _this ;
188
188
}
189
189
190
- return PatchError ;
190
+ return RollbackError ;
191
191
} ( _extendableBuiltin ( Error ) ) ;
192
192
193
193
var createPatchModel = function createPatchModel ( options ) {
0 commit comments