UniCoreFW

is_error()

Check if obj is an error instance.

Implementation

Args: obj: The object to check Returns: True if obj is an exception, False otherwise

Example

is_error(Exception())

Expected output: True

Source Code

def is_error(obj: Any) -> bool: return isinstance(obj, Exception)