From: Cameron Patrick Date: Sun, 1 Aug 2004 05:02:16 +0000 (+0000) Subject: tidy up exception handling code X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=b740ff0b251e29a03db4471062edc45fa6734735;p=zanchey%2Fdispense2.git tidy up exception handling code --- diff --git a/sql-edition/servers/VendServer.py b/sql-edition/servers/VendServer.py index 4a601b7..ad972ca 100755 --- a/sql-edition/servers/VendServer.py +++ b/sql-edition/servers/VendServer.py @@ -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)