Skip to content

Commit 6824c50

Browse files
authored
chore: Update ValidationAspect.php to include previous exception in ValidationException (#682)
Co-authored-by: Deeka Wong <8337659+huangdijia@users.noreply.github.com>
1 parent f468ed1 commit 6824c50

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/Annotation/ValidationAspect.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ public function process(ProceedingJoinPoint $proceedingJoinPoint)
4848
Context::set(ValidatorInterface::class, $validator);
4949

5050
if ($resolve && $validator->fails()) {
51-
throw new ValidationException($validator->errors()->first());
51+
throw new ValidationException(
52+
$validator->errors()->first(),
53+
previous: new \Hyperf\Validation\ValidationException($validator)
54+
);
5255
}
5356
}
5457

0 commit comments

Comments
 (0)