9 BotSense Error Classes and Supporting Routines 59 import BotSenseCore
as bsCore
63 """ Get the error string describing the BotSense error code. 65 The absolute value of the error code is taken prior retrieving the 66 string. An unknown or out-of-range error code will be mapped to 70 ecode - BotSense error code. 73 The appropriate error code string. 75 sErr = bsCore.bsStrError(ecode)
83 """ Check of oject is an instance of type T. 85 Raises a BotSenseError exception if false. 88 obj - Object instance. 91 if not isinstance(obj, T):
92 if hasattr(T,
'__name__'):
94 elif hasattr(T,
'__class__.__name__'):
95 name = T.__class__.__name__
99 "Object type is not the '%s' required type." % (name))
104 """ Check if return is ok (BsOk). 106 Raises a BotSenseError exception if false. 109 rc - BotSense return code. 110 emsg - Optional error message string. 112 if rc != bsCore.BS_OK:
118 """ Check if return is non-negative. 120 Raises a BotSenseError exception if false. 123 rc - BotSense return code. 124 emsg - Optional error message string. 135 """ BotSense Exception Class. """ 142 ecode - BotSense error code. 143 msg - Exception message string. 154 """ String representation. """ 157 s +=
": %s" % (self.
emsg)
def __init__(self, ecode, emsg=None)
ecode
<b><i>BotSense</i></b> error code
def ChkReturnIsOk(rc, emsg=None)
def ChkReturnIsNonNeg(rc, emsg=None)