Mercurial > libervia-backend
diff frontends/src/quick_frontend/quick_app.py @ 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 | 7ea6d5a86e58 |
line wrap: on
line diff
--- a/frontends/src/quick_frontend/quick_app.py Thu Jun 20 17:44:27 2013 +0200 +++ b/frontends/src/quick_frontend/quick_app.py Fri Jun 21 02:00:37 2013 +0200 @@ -17,9 +17,11 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. +import sys from logging import debug, info, warning, error from sat.tools.jid import JID -from sat_frontends.bridge.DBus import DBusBridgeFrontend,BridgeExceptionNoService +from sat_frontends.bridge.DBus import DBusBridgeFrontend +from sat.core.exceptions import BridgeExceptionNoService, BridgeInitError from sat_frontends.quick_frontend.quick_utils import escapePrivate, unescapePrivate from optparse import OptionParser @@ -41,7 +43,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.bridge.register("connected", self.connected) self.bridge.register("disconnected", self.disconnected)