File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -275,9 +275,20 @@ def run():
275275 rich_handler .setLevel (logging .DEBUG if args .debug else logging .INFO )
276276
277277 # Set up websocket app and handler
278- client_id = requests .get (
278+ client_id_response = requests .get (
279279 f"{ murfey_url .geturl ()} { url_path_for ('session_control.router' , 'new_client_id' )} "
280- ).json ()
280+ )
281+ if client_id_response .status_code == 401 :
282+ exit (
283+ "This instrument is not authorised to run the TUI app; please use the "
284+ "Murfey web UI instead"
285+ )
286+ elif client_id_response .status_code != 200 :
287+ exit (
288+ "Unable to establish connection to Murfey server: \n "
289+ f"{ client_id_response .json ()} "
290+ )
291+ client_id : dict = client_id_response .json ()
281292 ws = murfey .client .websocket .WSApp (
282293 server = args .server ,
283294 id = client_id ["new_id" ],
You can’t perform that action at this time.
0 commit comments