diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2019-10-22 14:54:55 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2019-10-22 14:54:55 +0200 |
commit | 33e665c41928824a0410f0328a1fe9873381faaf (patch) | |
tree | d538df94ff6ca4550264f2a3438a1f13e84bf9be | |
parent | df69d473d3ab389e915698b8c2c4bb8d22975976 (diff) |
Handle invalid_argument when constructing build system module project name
-rw-r--r-- | libbuild2/module.cxx | 10 |
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>}. // |