Skip to main content

raise_with_context

Raises a new exception while preserving the current exception context by using the 'from' clause if an active exception exists.

def raise_with_context(
exc: Exception
) - > null

Raises an exception while preserving the current exception context to maintain a clear traceback for debugging.

Parameters

NameTypeDescription
excExceptionThe exception instance to be raised with the current execution context attached.

Returns

TypeDescription
nullThis function does not return as it always raises an exception.