diff sat_frontends/jp/base.py @ 3490:509f7a1c67dc

frontends: use new EXIT_BACKEND_NOT_FOUND exit code: - new EXIT_BACKEND_NOT_FOUND (5) is used when frontend can't find backend with the bridge. It differs from EXIT_BRIDGE_ERROR (3) which is used when something went wrong when connecting to backend. - use this exit code in quick app and in jp
author Goffi <goffi@goffi.org>
date Tue, 23 Mar 2021 21:21:00 +0100
parents c9703067c700
children 1ac5570fa998
line wrap: on
line diff
--- a/sat_frontends/jp/base.py	Sun Mar 21 22:00:55 2021 +0100
+++ b/sat_frontends/jp/base.py	Tue Mar 23 21:21:00 2021 +0100
@@ -649,11 +649,13 @@
         except Exception as e:
             if isinstance(e, exceptions.BridgeExceptionNoService):
                 print((_("Can't connect to SàT backend, are you sure it's launched ?")))
+                self.quit(C.EXIT_BACKEND_NOT_FOUND, raise_exc=False)
             elif isinstance(e, exceptions.BridgeInitError):
                 print((_("Can't init bridge")))
+                self.quit(C.EXIT_BRIDGE_ERROR, raise_exc=False)
             else:
                 print((_(f"Error while initialising bridge: {e}")))
-            self.quit(C.EXIT_BRIDGE_ERROR, raise_exc=False)
+                self.quit(C.EXIT_BRIDGE_ERROR, raise_exc=False)
             return
         self.version = await self.bridge.getVersion()
         self._bridgeConnected()