aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-10-22 14:54:55 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-10-22 14:54:55 +0200
commit33e665c41928824a0410f0328a1fe9873381faaf (patch)
treed538df94ff6ca4550264f2a3438a1f13e84bf9be
parentdf69d473d3ab389e915698b8c2c4bb8d22975976 (diff)
Handle invalid_argument when constructing build system module project name
-rw-r--r--libbuild2/module.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/libbuild2/module.cxx b/libbuild2/module.cxx
index c6c6c3d..45cbd30 100644
--- a/libbuild2/module.cxx
+++ b/libbuild2/module.cxx
@@ -132,7 +132,15 @@ namespace build2
// If this is one of the bundled modules, the project name is build2,
// otherwise -- libbuild2-<mod>.
//
- project_name proj (bundled ? "build2" : "libbuild2-" + mod);
+ project_name proj;
+ try
+ {
+ proj = project_name (bundled ? "build2" : "libbuild2-" + mod);
+ }
+ catch (const invalid_argument& e)
+ {
+ fail (loc) << "invalid build system module '" << mod << "': " << e;
+ }
// The target we are looking for is <prj>%libs{build2-<mod>}.
//