repzo 1.0.12 → 1.0.13

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.
package/lib/index.js CHANGED
@@ -1112,7 +1112,15 @@ Repzo.ActionLogs = class {
1112
1112
  });
1113
1113
  this.status = status;
1114
1114
  if (error) {
1115
- this.error = error;
1115
+ if (typeof error == "string") {
1116
+ this.error = { message: error };
1117
+ } else {
1118
+ this.error = {
1119
+ message: error.message,
1120
+ responseData: error.response?.data,
1121
+ };
1122
+ }
1123
+ return this;
1116
1124
  }
1117
1125
  return this;
1118
1126
  }
@@ -1227,7 +1235,15 @@ Repzo.CommandLog = class {
1227
1235
  this.addDetail(`status was changed from ${this.status} to ${status}`);
1228
1236
  this.status = status;
1229
1237
  if (error) {
1230
- this.error = error;
1238
+ if (typeof error == "string") {
1239
+ this.error = { message: error };
1240
+ } else {
1241
+ this.error = {
1242
+ message: error.message,
1243
+ responseData: error.response?.data,
1244
+ };
1245
+ }
1246
+ return this;
1231
1247
  }
1232
1248
  switch (status) {
1233
1249
  case "fail":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repzo",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "Repzo TypeScript SDK",
5
5
  "main": "./lib/index.js",
6
6
  "type": "module",
package/src/index.ts CHANGED
@@ -1556,7 +1556,15 @@ export default class Repzo {
1556
1556
  });
1557
1557
  this.status = status;
1558
1558
  if (error) {
1559
- this.error = error;
1559
+ if (typeof error == "string") {
1560
+ this.error = { message: error };
1561
+ } else {
1562
+ this.error = {
1563
+ message: error.message,
1564
+ responseData: error.response?.data,
1565
+ };
1566
+ }
1567
+ return this;
1560
1568
  }
1561
1569
  return this;
1562
1570
  }
@@ -1706,7 +1714,15 @@ export default class Repzo {
1706
1714
  this.addDetail(`status was changed from ${this.status} to ${status}`);
1707
1715
  this.status = status;
1708
1716
  if (error) {
1709
- this.error = error;
1717
+ if (typeof error == "string") {
1718
+ this.error = { message: error };
1719
+ } else {
1720
+ this.error = {
1721
+ message: error.message,
1722
+ responseData: error.response?.data,
1723
+ };
1724
+ }
1725
+ return this;
1710
1726
  }
1711
1727
  switch (status) {
1712
1728
  case "fail":