Module ivit_i.common.error
Functions
def handle_exception(error: Optional[Exception] = None, title: str = '', exit: bool = False) ‑> str
-
Handle exception and return concatenated message
Args
error
:Union[Exception, None]
, optional- the exception need parse. Defaults to None.
title
:str
, optional- the error title. Defaults to "".
exit
:bool
, optional- need to exit system. Defaults to False.
Returns
str
- return concatenated error message: "{title} [{type}] {detail} ( {file_name} in line {line_num} )"
def parse_exception(error: Optional[Exception] = None) ‑> tuple
-
Parse Exception
Args
error
:Union[Exception, None]
, optional- the exception need parse. Defaults to None.
Returns
tuple
- description
def simple_exception(error: Optional[Exception] = None) ‑> Tuple[str, str]
-
Provide simple exception format which only has type and detail
Args
error
:Union[Exception, None]
, optional- the exception need parse. Defaults to None.
Returns
Tuple[str, str]
- return the type and detail of exception