@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.cjs +7 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
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
|
-
|
|
811
|
-
|
|
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
|
};
|