Return 500 errors for command timeout
Bumper was returning an invalid errno when a command for MQTT would timeout. Change to return a 500 errno with a debug message. Closes #31
This commit is contained in:
parent
38f31a8e69
commit
5bf202189d
2 changed files with 4 additions and 2 deletions
|
|
@ -1164,7 +1164,7 @@ class ConfServer:
|
||||||
json_body["toId"]
|
json_body["toId"]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
body = {"id": randomid, "errno": bumper.ERR_COMMON, "ret": "fail"}
|
body = {"id": randomid, "errno": 500, "ret": "fail", "debug": "wait for response timed out"}
|
||||||
return web.json_response(body)
|
return web.json_response(body)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -142,11 +142,13 @@ class MQTTHelperBot:
|
||||||
self.command_responses.set(cresp)
|
self.command_responses.set(cresp)
|
||||||
return resp
|
return resp
|
||||||
|
|
||||||
return {"id": requestid, "errno": "timeout", "ret": "fail"}
|
return {"id": requestid, "errno": 500, "ret": "fail", "debug": "wait for response timed out"}
|
||||||
except asyncio.CancelledError as e:
|
except asyncio.CancelledError as e:
|
||||||
helperbotlog.debug("wait_for_resp cancelled by asyncio")
|
helperbotlog.debug("wait_for_resp cancelled by asyncio")
|
||||||
|
return {"id": requestid, "errno": 500, "ret": "fail", "debug": "wait for response timed out"}
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
helperbotlog.exception("{}".format(e))
|
helperbotlog.exception("{}".format(e))
|
||||||
|
return {"id": requestid, "errno": 500, "ret": "fail", "debug": "wait for response timed out"}
|
||||||
|
|
||||||
async def send_command(self, cmdjson, requestid):
|
async def send_command(self, cmdjson, requestid):
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue