Catching exception on validating YAML