Skip to content

Commit

Permalink
raise a yaml exception when time cannot be parsed
Browse files Browse the repository at this point in the history
  • Loading branch information
jwaldrip committed Aug 17, 2017
1 parent 14f3f32 commit 3683bbc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/yaml/from_yaml.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3683bbc

Please sign in to comment.