Skip to content

Commit

Permalink
Merge pull request #160 from utiasASRL/metatdata_fix
Browse files Browse the repository at this point in the history
Fix metadata with -1
  • Loading branch information
lisusdaniil authored Feb 7, 2023
2 parents 2ea8eb3 + 9fa05eb commit 866e231
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main/src/vtr_storage/src/storage/metadata_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ struct convert<std::chrono::time_point<std::chrono::high_resolution_clock>>
{
Node node;
node["nanoseconds_since_epoch"] = start_time.time_since_epoch().count();
if (start_time.time_since_epoch().count() < 0) {
node["nanoseconds_since_epoch"] = 0;
}
return node;
}

Expand Down Expand Up @@ -285,7 +288,7 @@ BagMetadata MetadataIo::read_metadata(const std::string & uri)
}
return metadata;
} catch (const YAML::Exception & ex) {
throw std::runtime_error(std::string("Exception on parsing info file: ") + ex.what());
throw std::runtime_error(std::string("Exception while parsing info file: " + get_metadata_file_name(uri) + " ") + ex.what());
}
}

Expand Down

0 comments on commit 866e231

Please sign in to comment.