catch msgpack decode errors

This commit is contained in:
wh1te909 2021-04-08 06:48:43 +00:00
parent ab15a2448d
commit a8236f69bf
1 changed files with 5 additions and 1 deletions

View File

@ -651,7 +651,11 @@ class Agent(BaseAuditModel):
except ErrTimeout: except ErrTimeout:
ret = "timeout" ret = "timeout"
else: else:
ret = msgpack.loads(msg.data) # type: ignore try:
ret = msgpack.loads(msg.data) # type: ignore
except Exception as e:
logger.error(e)
ret = str(e)
await nc.close() await nc.close()
return ret return ret