@marqeta/ux-toolkit-sdk-javascript 2.22.2 → 2.23.0

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.
@@ -1310,7 +1310,14 @@ var _MqSDKError = /*#__PURE__*/ function(Error1) {
1310
1310
  if (err && _instanceof(err, _MqSDKError) && err.originalError) {
1311
1311
  _this.originalError = err.originalError;
1312
1312
  } else if (err) {
1313
- _this.originalError = err;
1313
+ if (err.debug) {
1314
+ _this.originalError = _object_spread({
1315
+ message: err.msg || err.message || "Unknown error",
1316
+ debug: err.debug
1317
+ }, err);
1318
+ } else {
1319
+ _this.originalError = err;
1320
+ }
1314
1321
  }
1315
1322
  return _this;
1316
1323
  }
@@ -4206,7 +4213,8 @@ function _checkHttpStandizedError() {
4206
4213
  return {
4207
4214
  source: item.source,
4208
4215
  code: item.code,
4209
- err: new Error(item.message || "Unknown error")
4216
+ err: new Error(item.message || "Unknown error"),
4217
+ data: item.data
4210
4218
  };
4211
4219
  });
4212
4220
  stdError = new StandardizedError(error2.id, convertedDebug, error2.details);
@@ -1297,7 +1297,14 @@ var _MqSDKError = /*#__PURE__*/ function(Error1) {
1297
1297
  if (err && _instanceof(err, _MqSDKError) && err.originalError) {
1298
1298
  _this.originalError = err.originalError;
1299
1299
  } else if (err) {
1300
- _this.originalError = err;
1300
+ if (err.debug) {
1301
+ _this.originalError = _object_spread({
1302
+ message: err.msg || err.message || "Unknown error",
1303
+ debug: err.debug
1304
+ }, err);
1305
+ } else {
1306
+ _this.originalError = err;
1307
+ }
1301
1308
  }
1302
1309
  return _this;
1303
1310
  }
@@ -4208,7 +4215,8 @@ function _checkHttpStandizedError() {
4208
4215
  return {
4209
4216
  source: item.source,
4210
4217
  code: item.code,
4211
- err: new Error(item.message || "Unknown error")
4218
+ err: new Error(item.message || "Unknown error"),
4219
+ data: item.data
4212
4220
  };
4213
4221
  });
4214
4222
  stdError = new StandardizedError(error2.id, convertedDebug, error2.details);
package/dist/index.d.mts CHANGED
@@ -925,7 +925,7 @@ declare class CleanupOnUnload {
925
925
 
926
926
  declare class MqSDKError extends Error {
927
927
  msg: string;
928
- originalError: Error | undefined;
928
+ originalError: any;
929
929
  status?: number;
930
930
  constructor(msg: string, err?: any);
931
931
  }
@@ -934,6 +934,7 @@ type DebugItem = {
934
934
  source: string;
935
935
  code?: string;
936
936
  err: Error;
937
+ data?: any;
937
938
  };
938
939
  declare class StandardizedError extends Error {
939
940
  msg: string;
package/dist/index.d.ts CHANGED
@@ -925,7 +925,7 @@ declare class CleanupOnUnload {
925
925
 
926
926
  declare class MqSDKError extends Error {
927
927
  msg: string;
928
- originalError: Error | undefined;
928
+ originalError: any;
929
929
  status?: number;
930
930
  constructor(msg: string, err?: any);
931
931
  }
@@ -934,6 +934,7 @@ type DebugItem = {
934
934
  source: string;
935
935
  code?: string;
936
936
  err: Error;
937
+ data?: any;
937
938
  };
938
939
  declare class StandardizedError extends Error {
939
940
  msg: string;