It's nice to separate "something internally went wrong" and "you mis-configured or passed bad flags".
Signed-off-by: Dylan Baker <[email protected]> --- framework/exceptions.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/framework/exceptions.py b/framework/exceptions.py index ffee7f315..6ca3ed773 100644 --- a/framework/exceptions.py +++ b/framework/exceptions.py @@ -56,6 +56,9 @@ def handler(func): print('Aborting Piglit execution: {}'.format(str(e)), file=sys.stderr) sys.exit(3) + except PiglitUserError as e: + print('User error: {}'.format(str(e)), file=sys.stderr) + sys.exit(1) return _inner @@ -94,6 +97,14 @@ class PiglitFatalError(Exception): """ +class PiglitUserError(Exception): + """Class for user configuration errors. + + When this class (or a subclass) is raised it should be raised all the way + to the top of the program where it exits. + """ + + class PiglitAbort(Exception): """Class for non-errors that require piglit aborting. -- 2.12.2 _______________________________________________ Piglit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/piglit
