Skip to content

Commit

Permalink
Merge pull request #47 from Hanmac/patch-1
Browse files Browse the repository at this point in the history
Fix ExceptionType for Form
  • Loading branch information
loevgaard authored Aug 19, 2024
2 parents c80b1f9 + 4b0d92f commit 3f608de
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ public function reverseTransform($value): CronExpression
throw new TransformationFailedException('Expected an instance of string');
}

return CronExpression::factory($value);
try {
return CronExpression::factory($value);
} catch (\InvalidArgumentException $ex) {
throw new TransformationFailedException('Invalid CronExpression', $ex->getCode(), $ex);
}
}
}

0 comments on commit 3f608de

Please sign in to comment.