All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xmlrpc: Show a better error message for connection failures
@ 2013-10-04 13:15 Richard Purdie
  0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2013-10-04 13:15 UTC (permalink / raw)
  To: bitbake-devel

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>
---
diff --git a/bitbake/lib/bb/server/xmlrpc.py b/bitbake/lib/bb/server/xmlrpc.py
index 389327a..82c0e8d 100644
--- a/bitbake/lib/bb/server/xmlrpc.py
+++ b/bitbake/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()




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-10-04 13:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-04 13:15 [PATCH] xmlrpc: Show a better error message for connection failures Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.