@xeno-js/core 4.2.2 → 5.0.1

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.cjs CHANGED
@@ -804,13 +804,15 @@ var SchemaValidationStrategy = class {
804
804
  async execute(request) {
805
805
  const key = request.intent;
806
806
  const parseResult = await this._validator.validate(key, request);
807
- if (!parseResult.isOk())
807
+ if (!parseResult.isOk()) {
808
+ const validatorError = parseResult.getErrorOrThrow();
809
+ const details = validatorError.cause instanceof Error ? validatorError.cause.message : validatorError.message;
808
810
  return import_shared23.Result.fail(
809
- import_shared23.AppError.validationError(
810
- request.intent,
811
- `Validation failed: ${parseResult.getErrorOrThrow().message}`
812
- )
811
+ Object.assign(import_shared23.AppError.validationError(request.intent, `Validation failed: ${details}`), {
812
+ validatorError
813
+ })
813
814
  );
815
+ }
814
816
  return import_shared23.Result.ok(true);
815
817
  }
816
818
  };