tidyexc.only_raise

tidyexc.only_raise(*err_cls)[source]

Guarantee that the decorated function can only raise the given types of exception.

At least one type of exceptions must be specified. Any unhandled exception raised by the decorated function will be caught and re-raised using an exception of the first given type.