@alienplatform/core 3.3.29 → 3.3.30

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/dist/index.js CHANGED
@@ -9212,8 +9212,10 @@ var AlienError = class AlienError extends Error {
9212
9212
  context: contextData
9213
9213
  };
9214
9214
  } else options = input;
9215
+ const sourceOptions = options.source;
9216
+ const source = sourceOptions && typeof sourceOptions === "object" && "code" in sourceOptions && "message" in sourceOptions && "retryable" in sourceOptions && "internal" in sourceOptions ? new AlienError(sourceOptions) : void 0;
9215
9217
  const message = options.message;
9216
- super(message, { cause: options.source });
9218
+ super(message, { cause: source });
9217
9219
  this.name = "AlienError";
9218
9220
  this.code = options.code;
9219
9221
  this.retryable = options.retryable;
@@ -9221,10 +9223,7 @@ var AlienError = class AlienError extends Error {
9221
9223
  this.httpStatusCode = options.httpStatusCode ?? 500;
9222
9224
  this.context = options.context;
9223
9225
  this.hint = options.hint;
9224
- this.source = void 0;
9225
- if (options.source && typeof options.source === "object") {
9226
- if ("code" in options.source && "message" in options.source && "retryable" in options.source && "internal" in options.source) this.source = new AlienError(options.source);
9227
- }
9226
+ this.source = source;
9228
9227
  }
9229
9228
  /**
9230
9229
  * Create an AlienError from a type-safe error definition.