tidy up exception handling code
authorCameron Patrick <[email protected]>
Sun, 1 Aug 2004 05:02:16 +0000 (05:02 +0000)
committerCameron Patrick <[email protected]>
Sun, 1 Aug 2004 05:02:16 +0000 (05:02 +0000)
sql-edition/servers/VendServer.py

index 4a601b7..ad972ca 100755 (executable)
@@ -7,7 +7,7 @@ import sys, os, string, re, pwd
 if USE_DB: import pg
 from time import time, sleep
 from popen2 import popen2
-from LATClient import LATClient
+from LATClient import LATClient, LATClientException
 from VendingMachine import VendingMachine, VendingException
 from HorizScroll import HorizScroll
 from random import random, seed
@@ -410,7 +410,7 @@ if __name__ == '__main__':
        while True:
                try:
                        rfh, wfh = connect_to_vend(options, DBServer, DBName, DBUser, DBPassword, ServiceName, ServicePassword, ServerName, ConnectPassword, PrivPassword)
-               except Exception:
+               except (LATClientException, socket.error):
                        (exc_type, exc_value, exc_traceback) = sys.exc_info()
                        print "Connection error ("+str(exc_type)+"):"
                        print_tb(exc_traceback)

UCC git Repository :: git.ucc.asn.au