Skip to content

Commit

Permalink
feat: new error handler check
Browse files Browse the repository at this point in the history
Update sas.py
  • Loading branch information
well-it-wasnt-me authored Mar 4, 2024
2 parents c17eecf + 56f7ec2 commit 9a28596
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions sas.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,19 +190,18 @@ def _send_command(
except ValueError as e:
self.log.critical("no sas response %s" % (str(buf_header[1:])))
return None
else:
if int(binascii.hexlify(response)[2:4], 16) != buf_header[1]:
raise BadCommandIsRunning('response %s run %s' % (binascii.hexlify(response), binascii.hexlify(bytearray(buf_header))))

response = Crc.validate(response)

self.log.debug("sas response %s", binascii.hexlify(response))

return response

except BadCRC as e:
raise e


except Exception as e:
self.log.critical(e, exc_info=True)

return None

@deprecated("use utils.Crc validation fuction")
Expand Down

0 comments on commit 9a28596

Please sign in to comment.