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
This commit is contained in:
parent
62f0f52ec6
commit
8e2f394b5b
1 changed files with 55 additions and 26 deletions
|
|
@ -53,7 +53,8 @@ from os.path import abspath, basename, dirname
|
|||
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 @@ class JP(object):
|
|||
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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue