From db1cdc89994cf3b11fed25f9753fc46209b5d6ef Mon Sep 17 00:00:00 2001 From: Matteo Campinoti Date: Tue, 21 Nov 2023 12:50:19 +0100 Subject: [PATCH] utils:helpers - update ExceptionManager docstring Describe behaviour of exceptions whose class is declared in `catch` but whose subclass(es) is in `allow`. --- acacore/utils/helpers.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/acacore/utils/helpers.py b/acacore/utils/helpers.py index 24cb50f..e3429c1 100644 --- a/acacore/utils/helpers.py +++ b/acacore/utils/helpers.py @@ -8,6 +8,9 @@ class ExceptionManager: """ A context manager class that catches specified exceptions and stores the exception and traceback for later use. + Exceptions whose class is explicitly declared in the 'catch' argument are always caught, + even if they subclass from classes passed int the 'allow' argument. + Args: *catch (Type[BaseException]): Exception types that should be caught and not allowed to rise.