From 23e619793c9b33a8df9280c031511c5f5adada34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20G=C3=BCndling?= Date: Wed, 27 Nov 2024 19:01:59 +0100 Subject: [PATCH] annotate loading failures with path --- src/loader/load.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/loader/load.cc b/src/loader/load.cc index 5c9b4e4e..b9d3f9b3 100644 --- a/src/loader/load.cc +++ b/src/loader/load.cc @@ -49,7 +49,11 @@ timetable load(std::vector> 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 {