pytabs.error_handle
1# pyTABS - ETABS .NET API python wrapper 2# ErrorHandling - for pyTABS exceptions 3__all__ = ['handle'] 4 5class Error(Exception): 6 """Error base class for non-exit exceptions""" 7 pass 8 9class EtabsError(Error): 10 """General ETABS API Error Class""" 11 def __init__(self, ret : int, msg : str = 'EtabsError: Unknown API error.'): 12 self.ret : int = ret 13 self.msg : str = msg 14 15 16def handle(ret : int) -> None: 17 """Handles ETABS API return. 18 19 :param ret: return integer from ETABS API function 20 :type ret: int 21 :raises EtabsError: general ETABS API error if return int is != 0 22 """ 23 if ret != 0: 24 raise EtabsError(ret=ret)
def
handle(ret: int) -> None:
17def handle(ret : int) -> None: 18 """Handles ETABS API return. 19 20 :param ret: return integer from ETABS API function 21 :type ret: int 22 :raises EtabsError: general ETABS API error if return int is != 0 23 """ 24 if ret != 0: 25 raise EtabsError(ret=ret)
Handles ETABS API return.
Parameters
- ret: return integer from ETABS API function
Raises
- EtabsError: general ETABS API error if return int is != 0