diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-10-04 14:15:36 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-10-04 15:34:13 +0100 |
commit | 26913202f83fbbecdce95da59515af102bcde4a7 (patch) | |
tree | 2a8d6695507023f10c038d3d24ca460dcc290b33 /lib | |
parent | 719808f95adc7820fcc09743c592513414d03ce1 (diff) | |
download | bitbake-26913202f83fbbecdce95da59515af102bcde4a7.tar.gz |
xmlrpc: Show a better error message for connection failures
Showing a traceback when unable to connect to a bitbake server is
rather ugly. This change allows us to show a sensible error message.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bb/server/xmlrpc.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/bb/server/xmlrpc.py b/lib/bb/server/xmlrpc.py index 389327a60..82c0e8d8a 100644 --- a/lib/bb/server/xmlrpc.py +++ b/lib/bb/server/xmlrpc.py @@ -354,9 +354,12 @@ class BitBakeXMLRPCClient(BitBakeBaseServer): s.close() except: return None - self.serverImpl = XMLRPCProxyServer(host, port) - self.connection = BitBakeXMLRPCServerConnection(self.serverImpl, (ip, 0), self.observer_only, featureset) - return self.connection.connect() + try: + self.serverImpl = XMLRPCProxyServer(host, port) + self.connection = BitBakeXMLRPCServerConnection(self.serverImpl, (ip, 0), self.observer_only, featureset) + return self.connection.connect() + except Exception as e: + bb.fatal("Could not connect to server at %s:%s (%s)" % (host, port, str(e))) def endSession(self): self.connection.removeClient() |