From 33e665c41928824a0410f0328a1fe9873381faaf Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 22 Oct 2019 14:54:55 +0200 Subject: Handle invalid_argument when constructing build system module project name --- libbuild2/module.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'libbuild2/module.cxx') 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-. // - 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 %libs{build2-}. // -- cgit v1.1