From b740ff0b251e29a03db4471062edc45fa6734735 Mon Sep 17 00:00:00 2001 From: Cameron Patrick Date: Sun, 1 Aug 2004 05:02:16 +0000 Subject: [PATCH] tidy up exception handling code --- sql-edition/servers/VendServer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) -- 2.20.1