@xeno-js/core 5.0.0 → 5.0.2

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
@@ -752,13 +752,15 @@ var SchemaValidationStrategy = class {
752
752
  async execute(request) {
753
753
  const key = request.intent;
754
754
  const parseResult = await this._validator.validate(key, request);
755
- if (!parseResult.isOk())
755
+ if (!parseResult.isOk()) {
756
+ const validatorError = parseResult.getErrorOrThrow();
757
+ const details = validatorError.cause instanceof Error ? validatorError.cause.message : validatorError.message;
756
758
  return Result11.fail(
757
- AppError11.validationError(
758
- request.intent,
759
- `Validation failed: ${parseResult.getErrorOrThrow().message}`
760
- )
759
+ Object.assign(AppError11.validationError(request.intent, `Validation failed: ${details}`), {
760
+ validatorError
761
+ })
761
762
  );
763
+ }
762
764
  return Result11.ok(true);
763
765
  }
764
766
  };