Skip to content

Commit

Permalink
annotate loading failures with path
Browse files Browse the repository at this point in the history
  • Loading branch information
felixguendling committed Nov 27, 2024
1 parent 802aaea commit 23e6197
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/loader/load.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ timetable load(std::vector<std::pair<std::string, loader_config>> const& paths,
if (!is_in_memory) {
log(log_lvl::info, "loader.load", "loading {}", path);
}
(*it)->load(local_config, src, *dir, tt, bitfields, a, shapes);
try {
(*it)->load(local_config, src, *dir, tt, bitfields, a, shapes);
} catch (std::exception const& e) {
throw utl::fail("failed to load {}: {}", path, e.what());
}
} else if (!ignore) {
throw utl::fail("no loader for {} found", path);
} else {
Expand Down

0 comments on commit 23e6197

Please sign in to comment.