more info in error messages

This commit is contained in:
Olga Khlopkova 2020-04-28 11:25:36 +03:00
parent a5584e1c42
commit 384884ed6f

View file

@ -147,11 +147,11 @@ inline Result CsvParser::read_header(const std::string & csv_filename)
csv_stream.open(gtfs_path / csv_filename);
if (!csv_stream.is_open())
return {ResultCode::ERROR_FILE_ABSENT, {}};
return {ResultCode::ERROR_FILE_ABSENT, "File " + csv_filename + "could not be opened"};
std::string header;
if (!getline(csv_stream, header) || header.empty())
return {ResultCode::ERROR_INVALID_FIELD_FORMAT, {}};
return {ResultCode::ERROR_INVALID_FIELD_FORMAT, "Empty header in file " + csv_filename};
field_sequence = split_record(header, true);
return {ResultCode::OK, {}};