Merge "Validate correct exception subclass in 'raise_with_cause'"
This commit is contained in:
@@ -46,6 +46,8 @@ def raise_with_cause(exc_cls, message, *args, **kwargs):
|
||||
:param kwargs: any additional keyword arguments to pass to the
|
||||
exceptions constructor.
|
||||
"""
|
||||
if not issubclass(exc_cls, TaskFlowException):
|
||||
raise ValueError("Subclass of taskflow exception is required")
|
||||
if 'cause' not in kwargs:
|
||||
exc_type, exc, exc_tb = sys.exc_info()
|
||||
if exc is not None:
|
||||
|
||||
Reference in New Issue
Block a user