mirror of
https://github.com/liamcottle/reticulum-meshchat.git
synced 2026-12-05 06:10:01 -05:00
throw helpful exception when initiating a call fails
This commit is contained in:
parent
c9541fd532
commit
bc865615d4
2 changed files with 17 additions and 10 deletions
19
web.py
19
web.py
|
|
@ -227,15 +227,18 @@ class ReticulumWebChat:
|
|||
destination_hash = bytes.fromhex(destination_hash)
|
||||
|
||||
# initiate audio call
|
||||
link_hash = await self.audio_call_manager.initiate(destination_hash, timeout_seconds)
|
||||
if link_hash is None:
|
||||
return web.json_response({
|
||||
"message": "timed out initiating call",
|
||||
}, status=503)
|
||||
try:
|
||||
|
||||
return web.json_response({
|
||||
"hash": link_hash.hex(),
|
||||
})
|
||||
link_hash = await self.audio_call_manager.initiate(destination_hash, timeout_seconds)
|
||||
return web.json_response({
|
||||
"hash": link_hash.hex(),
|
||||
})
|
||||
|
||||
except Exception as e:
|
||||
|
||||
return web.json_response({
|
||||
"message": "Call Failed: {}".format(str(e)),
|
||||
}, status=503)
|
||||
|
||||
# handle websocket client for sending and receiving audio packets in a call
|
||||
@routes.get("/api/v1/calls/{audio_call_link_hash}/audio")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue