Skip to content

Commit

Permalink
more info in error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
mesozoic-drones committed Apr 28, 2020
1 parent a5584e1 commit 384884e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/just_gtfs/just_gtfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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, {}};
Expand Down

0 comments on commit 384884e

Please sign in to comment.