backendless 7.2.2 → 7.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,10 +30,11 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
30
30
  var TransactionOperationError = /*#__PURE__*/function (_Error) {
31
31
  (0, _inherits2["default"])(TransactionOperationError, _Error);
32
32
  var _super = _createSuper(TransactionOperationError);
33
- function TransactionOperationError(message, operation) {
33
+ function TransactionOperationError(error, operation) {
34
34
  var _this;
35
35
  (0, _classCallCheck2["default"])(this, TransactionOperationError);
36
- _this = _super.call(this, message);
36
+ _this = _super.call(this, error.message);
37
+ _this.code = error.code;
37
38
  _this.operation = operation;
38
39
  return _this;
39
40
  }
@@ -193,7 +194,7 @@ var UnitOfWork = /*#__PURE__*/function () {
193
194
  var operation = this.payload.operations.find(function (op) {
194
195
  return result.error.operation.opResultId === op.meta.opResult.getOpResultId();
195
196
  });
196
- result.error = new TransactionOperationError(result.error.message, operation.meta.opResult);
197
+ result.error = new TransactionOperationError(result.error, operation.meta.opResult);
197
198
  operation.meta.opResult.setError(result.error);
198
199
  }
199
200
  return new UnitOfWorkResult(result);
@@ -30,10 +30,11 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
30
30
  var TransactionOperationError = /*#__PURE__*/function (_Error) {
31
31
  (0, _inherits2["default"])(TransactionOperationError, _Error);
32
32
  var _super = _createSuper(TransactionOperationError);
33
- function TransactionOperationError(message, operation) {
33
+ function TransactionOperationError(error, operation) {
34
34
  var _this;
35
35
  (0, _classCallCheck2["default"])(this, TransactionOperationError);
36
- _this = _super.call(this, message);
36
+ _this = _super.call(this, error.message);
37
+ _this.code = error.code;
37
38
  _this.operation = operation;
38
39
  return _this;
39
40
  }
@@ -193,7 +194,7 @@ var UnitOfWork = /*#__PURE__*/function () {
193
194
  var operation = this.payload.operations.find(function (op) {
194
195
  return result.error.operation.opResultId === op.meta.opResult.getOpResultId();
195
196
  });
196
- result.error = new TransactionOperationError(result.error.message, operation.meta.opResult);
197
+ result.error = new TransactionOperationError(result.error, operation.meta.opResult);
197
198
  operation.meta.opResult.setError(result.error);
198
199
  }
199
200
  return new UnitOfWorkResult(result);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backendless",
3
- "version": "7.2.2",
3
+ "version": "7.2.3",
4
4
  "description": "Backendless JavaScript SDK for Node.js and the browser",
5
5
  "browser": "dist/backendless.js",
6
6
  "main": "lib/index.js",
@@ -7,9 +7,10 @@ import { OpResult } from './op-result'
7
7
  import { OpResultValueReference } from './op-result-value-reference'
8
8
 
9
9
  class TransactionOperationError extends Error {
10
- constructor(message, operation) {
11
- super(message)
10
+ constructor(error, operation) {
11
+ super(error.message)
12
12
 
13
+ this.code = error.code
13
14
  this.operation = operation
14
15
  }
15
16
 
@@ -143,7 +144,7 @@ class UnitOfWork {
143
144
  return result.error.operation.opResultId === op.meta.opResult.getOpResultId()
144
145
  })
145
146
 
146
- result.error = new TransactionOperationError(result.error.message, operation.meta.opResult)
147
+ result.error = new TransactionOperationError(result.error, operation.meta.opResult)
147
148
 
148
149
  operation.meta.opResult.setError(result.error)
149
150
  }