Author: dmeyer
Date: Sun Apr 29 09:35:39 2007
New Revision: 2661

Modified:
   trunk/beacon/src/__init__.py

Log:
give better info when something is wrong on connect

Modified: trunk/beacon/src/__init__.py
==============================================================================
--- trunk/beacon/src/__init__.py        (original)
+++ trunk/beacon/src/__init__.py        Sun Apr 29 09:35:39 2007
@@ -60,6 +60,15 @@
 # signals of the client, only valid after calling connect()
 signals = {}
 
+debugging = """
+------------------------------------------------------------------------
+The system was unable to connect to beacon. Please check if the beacon
+server is running properly. If beacon processes exist, please kill them.
+Start beacon in an extra shell for better debugging. Start beacon with
+beacon --start --verbose all --fg
+------------------------------------------------------------------------
+"""
+
 def connect():
     """
     Connect to the beacon. A beacon server must be running. This function will
@@ -73,7 +82,13 @@
         return _client
 
     _client = Client()
-    thumbnail.connect()
+    try:
+        thumbnail.connect()
+    except RuntimeError:
+        # It was possible to connect to the beacon server but not
+        # to the thumbnailer. Something is very wrong.
+        log.error('unable to connect to beacon %s', debugging)
+        raise RuntimeError('Unable to connect to beacon')
     signals = _client.signals
     log.info('beacon connected')
     return _client
@@ -94,7 +109,9 @@
     cmd = 'beacon --start --verbose=%s' % verbose
     if autoshutdown:
         cmd += ' --autoshutdown'
-    os.system(cmd)
+    if os.system(cmd):
+        log.error('unable to connect to beacon %s', debugging)
+        raise RuntimeError('Unable to connect to beacon')
     return connect()
 
 

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to