I have this module A that might raise an exception from an imported module B. Can I "wrap" or "repack" the exception so that I can handle the exception in the importing script without having to import B?
A.py:
import B
def do_something(parameters):
try:
B.function(**parameters)
except B.some_exception as eee:
raise wrapper(eee)
script.py
import A
try:
do_something("glorious parameter")
except B.wrapped_exception:
handling()