From 864a6b5b06ed56b6471fea6c9776b2520a42b655 Mon Sep 17 00:00:00 2001 From: Lucas Meneghel Rodrigues Date: Wed, 7 May 2014 17:24:02 -0300 Subject: [PATCH] avocado.core.exceptions: Avoid avocado crashing on unknown error status Since someone might want to be funny and raise those exceptions, it is safer to make them to return "FAIL" instead of "NEVER_RAISE_THIS", so avocado does not crash. Signed-off-by: Lucas Meneghel Rodrigues --- avocado/core/exceptions.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/avocado/core/exceptions.py b/avocado/core/exceptions.py index dc2c2107..6d6442ba 100644 --- a/avocado/core/exceptions.py +++ b/avocado/core/exceptions.py @@ -21,8 +21,11 @@ class JobBaseException(Exception): """ The parent of all job exceptions. + + You should be never raising this, but just in case, we'll set its + status' as FAIL. """ - status = "NEVER_RAISE_THIS" + status = "FAIL" class JobError(Exception): @@ -37,8 +40,11 @@ class TestBaseException(Exception): """ The parent of all test exceptions. + + You should be never raising this, but just in case, we'll set its + status' as FAIL. """ - status = "NEVER_RAISE_THIS" + status = "FAIL" class TestSetupFail(TestBaseException): -- GitLab