Mercurial > libervia-backend
diff frontends/src/jp/jp @ 627:d207c2186519
core, bridge, jp, quick_frontend: SàT stop more gracefully if bridge can't be initialised:
- new BridgeInitError and BridgeExceptionNoService are in core.exceptions
- D-Bus NotSupported is catched in bridge, and launch a BridgeInitError
- BridgeInitError stop SàT core, jp, and quick_frontends with an explanation message.
fix bug 27
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 21 Jun 2013 02:00:37 +0200 |
parents | 0730fc83ef51 |
children | 09bbd5c00244 |
line wrap: on
line diff
--- a/frontends/src/jp/jp Thu Jun 20 17:44:27 2013 +0200 +++ b/frontends/src/jp/jp Fri Jun 21 02:00:37 2013 +0200 @@ -53,7 +53,8 @@ from optparse import OptionParser from sat.tools.jid import JID import gobject -from sat_frontends.bridge.DBus import DBusBridgeFrontend,BridgeExceptionNoService +from sat_frontends.bridge.DBus import DBusBridgeFrontend +from sat.core.exceptions import BridgeExceptionNoService, BridgeInitError from sat.tools.utils import clean_ustr import tarfile import tempfile @@ -74,7 +75,9 @@ self.bridge=DBusBridgeFrontend() except BridgeExceptionNoService: print(_(u"Can't connect to SàT backend, are you sure it's launched ?")) - import sys + sys.exit(1) + except BridgeInitError: + print(_(u"Can't init bridge")) sys.exit(1) self.transfer_data = None