diff --git a/pyghmi/ipmi/command.py b/pyghmi/ipmi/command.py index 7e24dec2..b8028907 100644 --- a/pyghmi/ipmi/command.py +++ b/pyghmi/ipmi/command.py @@ -384,7 +384,7 @@ class Command(object): if 'error' in rsp: if rsp['code'] == 203: # Sensor does not exist, optional dev continue - raise Exception(rsp['error']) + raise exc.IpmiException(rsp['error'], code=rsp['code']) yield self._sdr.sensors[sensor].decode_sensor_reading(rsp['data']) def get_sensor_descriptions(self): diff --git a/pyghmi/ipmi/private/constants.py b/pyghmi/ipmi/private/constants.py index 553a3097..98cbe909 100644 --- a/pyghmi/ipmi/private/constants.py +++ b/pyghmi/ipmi/private/constants.py @@ -1174,4 +1174,5 @@ ipmi_completion_codes = { 0xd5: "Command not supported in present state", 0xd6: "Cannot execute command because subfunction disabled or unavailable", 0xff: "Unspecified", + 0xffff: "Timeout", # not ipmi, but used internally } diff --git a/pyghmi/ipmi/private/session.py b/pyghmi/ipmi/private/session.py index a4181036..b3940c3e 100644 --- a/pyghmi/ipmi/private/session.py +++ b/pyghmi/ipmi/private/session.py @@ -1436,7 +1436,7 @@ class Session(object): self.nowait = True self.timeout += 1 if self.timeout > self.maxtimeout: - response = {'error': 'timeout'} + response = {'error': 'timeout', 'code': 0xffff} self.ipmicallback(response) self.nowait = False self._mark_broken()