Index: /main/waeup.uniben/trunk/src/waeup/uniben/interswitch/browser.py
===================================================================
--- /main/waeup.uniben/trunk/src/waeup/uniben/interswitch/browser.py	(revision 9744)
+++ /main/waeup.uniben/trunk/src/waeup/uniben/interswitch/browser.py	(revision 9745)
@@ -66,9 +66,6 @@
     }
     h.request('POST', URL, body=xml,headers=headers)
-    r = h.getresponse()
-    d = r.read()
-    if r.status!=200:
-        raise ValueError('Error connecting: %s, %s' % (r.status, r.reason))
-    return d
+    response = h.getresponse()
+    return response
 
 def get_SOAP_response(product_id, transref):
@@ -83,5 +80,8 @@
   </soap:Body>
 </soap:Envelope>""" % (product_id, transref)
-    result_xml=SOAP_post("http://tempuri.org/getTransactionData",xml)
+    response=SOAP_post("http://tempuri.org/getTransactionData",xml)
+    if response.status!=200:
+        return 'Connection error (%s, %s)' % (response.status, response.reason)
+    result_xml = response.read()
     doc=parseString(result_xml)
     response=doc.getElementsByTagName('getTransactionDataResult')[0].firstChild.data
@@ -90,4 +90,8 @@
 def query_interswitch(payment):
     sr = get_SOAP_response(PRODUCT_ID, payment.p_id)
+    if sr.startswith('Connection error'):
+        msg = _('Connection error')
+        log = sr
+        return False, msg, log
     wlist = sr.split(':')
     if len(wlist) != 7:
