Skip to content

Commit

Permalink
Print exception in peerconnection_serverless (#71)
Browse files Browse the repository at this point in the history
Signed-off-by: Ze Gan <[email protected]>
  • Loading branch information
Pterosaur authored Mar 30, 2021
1 parent 1c7451e commit 5aae8be
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions examples/peerconnection/serverless/peerconnection_serverless
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ def main():
cmdinfer.main(app.stdout, app.stdin)
app.wait()
except:
app.terminate()
app.wait()
error_message = traceback.format_exc()
error_message = "\n{}".format(error_message)
sys.stderr.write(error_message)
if len(sys.argv[1:]) == 0:
return
config_file = sys.argv[1]
Expand All @@ -31,13 +36,8 @@ def main():
return
if "enabled" not in config_file["logging"] or not config_file["logging"]["enabled"]:
return
app.terminate()
app.wait()
with open(config_file["logging"]["log_output_path"], "a") as log_file:
error_message = traceback.format_exc()
error_message = "\n{}".format(error_message)
log_file.write(error_message)
sys.stderr.write(error_message)


if __name__ == "__main__":
Expand Down

0 comments on commit 5aae8be

Please sign in to comment.