Updated False if failed login.

This commit is contained in:
retoor 2025-02-06 17:31:14 +01:00
parent b6185a95f3
commit 203314b209
2 changed files with 4 additions and 1 deletions

View File

@ -5,6 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Snek</title>
<style>{{highlight_styles}}</style>
<script src="/push.js"></script>
<script src="/upload-button.js"></script>
<script src="/html-frame.js"></script>
<script src="/schedule.js"></script>

View File

@ -127,13 +127,15 @@ class RPCView(BaseView):
method = getattr(self,method_name.replace(".","_"),None)
if not method:
raise Exception("Method not found")
success = True
try:
result = await method(*args)
except Exception as ex:
result = dict({"exception":str(ex),"traceback":traceback.format_exc()})
success = False
print(result,flush=True)
#dict(error=ex=str(ex),traceback=traceback.format_exc())
await self._send_json({"callId":call_id,"success":True,"data":result})
await self._send_json({"callId":call_id,"success":success,"data":result})
except Exception as ex:
await self._send_json({"callId":call_id,"success":False,"data":str(ex)})