aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mesonmain.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2017-09-29 10:13:56 -0700
committerJussi Pakkanen <jpakkane@gmail.com>2017-11-28 21:41:06 +0200
commit8a1a866c68dc432c4576221fdaf377490dba4925 (patch)
tree1fa326beff335ca0ac9c46669a3944ccb00bbfea /mesonbuild/mesonmain.py
parent5bc1009109431ad6f72d1ddfcf46ea718123a48b (diff)
downloadmeson-8a1a866c68dc432c4576221fdaf377490dba4925.zip
meson-8a1a866c68dc432c4576221fdaf377490dba4925.tar.gz
meson-8a1a866c68dc432c4576221fdaf377490dba4925.tar.bz2
Don't print traceback when options are invalid
Currently passing a bad combo or array option, providing a non-boolean to a bool arg, or a host of other things can cause an traceback from a MesonException, don't do that. Fixes #2683
Diffstat (limited to 'mesonbuild/mesonmain.py')
-rw-r--r--mesonbuild/mesonmain.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py
index fa8c9e3..f261935 100644
--- a/mesonbuild/mesonmain.py
+++ b/mesonbuild/mesonmain.py
@@ -300,7 +300,11 @@ def run(original_args, mainfile=None):
elif cmd_name == 'rewrite':
return rewriter.run(remaining_args)
elif cmd_name == 'configure':
- return mconf.run(remaining_args)
+ try:
+ return mconf.run(remaining_args)
+ except MesonException as e:
+ mlog.log(mlog.red('\nError configuring project:'), e)
+ sys.exit(1)
elif cmd_name == 'wrap':
return wraptool.run(remaining_args)
elif cmd_name == 'runpython':