Sfoglia il codice sorgente

utils: Don't show stack traces for BBHandledException

A BBHandledException means we already showed an error to the user so
we shouldn't show a stack trace as this just confuses things further.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Richard Purdie 10 anni fa
parent
commit
8a8bafc8de
1 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  1. 3 0
      lib/bb/utils.py

+ 3 - 0
lib/bb/utils.py

@@ -354,6 +354,9 @@ def better_exec(code, context, text = None, realfile = "<code>"):
         code = better_compile(code, realfile, realfile)
     try:
         exec(code, get_context(), context)
+    except bb.BBHandledException:
+        # Error already shown so passthrough
+        raise
     except Exception as e:
         (t, value, tb) = sys.exc_info()