throw exceptions from parseFile functions so that the caller can catch
errors.