From: erickson Date: Thu, 26 Jul 2007 20:30:52 +0000 (+0000) Subject: added a try/catch around the XML parsing and an error log X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=386630e4cbbd11f99571f8025ec649bec0e5aebe;p=opensrf%2Fbjwebb.git added a try/catch around the XML parsing and an error log git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1060 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/src/python/osrf/gateway.py b/src/python/osrf/gateway.py index a3d8215..ee2fd36 100644 --- a/src/python/osrf/gateway.py +++ b/src/python/osrf/gateway.py @@ -2,6 +2,7 @@ from xml.dom import minidom from xml.sax import handler, make_parser, saxutils from json import * from net_obj import * +from log import * import urllib, urllib2, sys, re defaultHost = None @@ -91,7 +92,12 @@ class XMLGatewayRequest(GatewayRequest): handler = XMLGatewayParser() parser = make_parser() parser.setContentHandler(handler) - parser.parse(response) + try: + parser.parse(response) + except Exception, e: + osrfLogErr('Error parsing gateway XML: %s' % str(e)) + return None + return handler.getResult() def encodeParam(self, param):