diff options
Diffstat (limited to 'libbuild2')
-rw-r--r-- | libbuild2/config/init.cxx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libbuild2/config/init.cxx b/libbuild2/config/init.cxx index 7035ce5..46239d8 100644 --- a/libbuild2/config/init.cxx +++ b/libbuild2/config/init.cxx @@ -429,8 +429,15 @@ namespace build2 auto load_config_file = [&load_config] (const path& f, const location& l) { path_name fn (f); - ifdstream ifs; - load_config (open_file_or_stdin (fn, ifs), fn, l); + try + { + ifdstream ifs; + load_config (open_file_or_stdin (fn, ifs), fn, l); + } + catch (const io_error& e) + { + fail << "unable to read buildfile " << fn << ": " << e; + } }; // Load config.build unless requested not to. |