Skip to content

Commit

Permalink
extended error message
Browse files Browse the repository at this point in the history
  • Loading branch information
mesozoic-drones committed Apr 28, 2020
1 parent 384884e commit 8ce210a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion include/just_gtfs/just_gtfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ 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, "File " + csv_filename + "could not be opened"};
return {ResultCode::ERROR_FILE_ABSENT, "File " + csv_filename + " could not be opened"};

std::string header;
if (!getline(csv_stream, header) || header.empty())
Expand Down Expand Up @@ -1520,7 +1520,10 @@ inline Result Feed::parse_csv(const std::string & filename,

Result res = add_entity(record);
if (res != ResultCode::OK)
{
res.message += " while adding item from " + filename;
return res;
}
}

return {ResultCode::OK, {"Parsed " + filename}};
Expand Down

0 comments on commit 8ce210a

Please sign in to comment.