Skip to content

Commit 3f608de

Browse files
authored
Merge pull request #47 from Hanmac/patch-1
Fix ExceptionType for Form
2 parents c80b1f9 + 4b0d92f commit 3f608de

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Form/DataTransformer/CronExpressionToStringTransformer.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ public function reverseTransform($value): CronExpression
3939
throw new TransformationFailedException('Expected an instance of string');
4040
}
4141

42-
return CronExpression::factory($value);
42+
try {
43+
return CronExpression::factory($value);
44+
} catch (\InvalidArgumentException $ex) {
45+
throw new TransformationFailedException('Invalid CronExpression', $ex->getCode(), $ex);
46+
}
4347
}
4448
}

0 commit comments

Comments
 (0)