Mercurial > libervia-backend
comparison 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 |
comparison
equal
deleted
inserted
replaced
3489:d71a163c0861 | 3490:509f7a1c67dc |
---|---|
647 try: | 647 try: |
648 await self.bridge.bridgeConnect() | 648 await self.bridge.bridgeConnect() |
649 except Exception as e: | 649 except Exception as e: |
650 if isinstance(e, exceptions.BridgeExceptionNoService): | 650 if isinstance(e, exceptions.BridgeExceptionNoService): |
651 print((_("Can't connect to SàT backend, are you sure it's launched ?"))) | 651 print((_("Can't connect to SàT backend, are you sure it's launched ?"))) |
652 self.quit(C.EXIT_BACKEND_NOT_FOUND, raise_exc=False) | |
652 elif isinstance(e, exceptions.BridgeInitError): | 653 elif isinstance(e, exceptions.BridgeInitError): |
653 print((_("Can't init bridge"))) | 654 print((_("Can't init bridge"))) |
655 self.quit(C.EXIT_BRIDGE_ERROR, raise_exc=False) | |
654 else: | 656 else: |
655 print((_(f"Error while initialising bridge: {e}"))) | 657 print((_(f"Error while initialising bridge: {e}"))) |
656 self.quit(C.EXIT_BRIDGE_ERROR, raise_exc=False) | 658 self.quit(C.EXIT_BRIDGE_ERROR, raise_exc=False) |
657 return | 659 return |
658 self.version = await self.bridge.getVersion() | 660 self.version = await self.bridge.getVersion() |
659 self._bridgeConnected() | 661 self._bridgeConnected() |
660 self.import_plugins() | 662 self.import_plugins() |
661 try: | 663 try: |