From 3683bbcf2ab71f4fd9e0c4b2dcb28e8faec4495c Mon Sep 17 00:00:00 2001 From: jwaldrip Date: Wed, 16 Aug 2017 19:47:09 -0600 Subject: [PATCH] raise a yaml exception when time cannot be parsed --- src/yaml/from_yaml.cr | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/yaml/from_yaml.cr b/src/yaml/from_yaml.cr index 98fe2c29c6f0..47320eb1fd2b 100644 --- a/src/yaml/from_yaml.cr +++ b/src/yaml/from_yaml.cr @@ -164,6 +164,8 @@ end def Time.new(pull : YAML::PullParser) Time::Format::ISO_8601_DATE_TIME.parse(pull.read_scalar) +rescue e : Time::Format::Error + raise YAML::ParseException.new(e.message, 0, 0) end struct Time::Format