Raising exception if asked to parse header from an empty file