diff options
author | Jukka Laurila <jlaurila@google.com> | 2018-03-10 13:18:15 +0100 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-03-10 18:04:52 +0200 |
commit | 52c50da6c7a921e1625fff26c7844af7d941afd9 (patch) | |
tree | e93c2d10aeed04b9a928f1387a469d98ef1524d8 /mesonbuild/rewriter.py | |
parent | f6fd03485e6ab95aae766649f621a9b4260ea674 (diff) | |
download | meson-52c50da6c7a921e1625fff26c7844af7d941afd9.zip meson-52c50da6c7a921e1625fff26c7844af7d941afd9.tar.gz meson-52c50da6c7a921e1625fff26c7844af7d941afd9.tar.bz2 |
Refactor: Add log.error and log.exception to reduce code duplication.
Diffstat (limited to 'mesonbuild/rewriter.py')
-rw-r--r-- | mesonbuild/rewriter.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/mesonbuild/rewriter.py b/mesonbuild/rewriter.py index 0191c30..fad7ba0 100644 --- a/mesonbuild/rewriter.py +++ b/mesonbuild/rewriter.py @@ -54,11 +54,7 @@ def run(args): sys.exit('Unknown command: ' + options.commands[0]) except Exception as e: if isinstance(e, MesonException): - if hasattr(e, 'file') and hasattr(e, 'lineno') and hasattr(e, 'colno'): - mlog.log(mlog.red('\nMeson encountered an error in file %s, line %d, column %d:' % (e.file, e.lineno, e.colno))) - else: - mlog.log(mlog.red('\nMeson encountered an error:')) - mlog.log(e) + mlog.exception(e) else: traceback.print_exc() return 1 |