From 113c1bd47a49b36aad637b43b225c90ac7760842 Mon Sep 17 00:00:00 2001 From: Petteri Stenius Date: Thu, 16 Nov 2023 20:28:22 +0200 Subject: [PATCH] improve startup error message when bind on http port fails --- src/vlei/server.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/vlei/server.py b/src/vlei/server.py index d0a9f5b..2304732 100644 --- a/src/vlei/server.py +++ b/src/vlei/server.py @@ -33,6 +33,8 @@ def launch(args): app = falcon.App() server = http.Server(port=int(args.http), app=app) + if not server.reopen(): + raise RuntimeError(f"cannot create http server on port {int(args.http)}") httpServerDoer = http.ServerDoer(server=server) serving.loadEnds(app, schemaDir=args.schemaDir, credDir=args.credDir, oobiDir=args.oobiDir)