Ignore:
Timestamp:
4 Aug 2017, 20:40:45 (7 years ago)
Author:
Henrik Bettermann
Message:

Catch socket error.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita/helpers.py

    r14753 r14769  
    5050            "lineItems":lineitems
    5151            }
    52     h.request("POST", url, body=json.dumps(data), headers=headers)
     52    try:
     53        h.request("POST", url, body=json.dumps(data), headers=headers)
     54    except:
     55        return {'error': 'Socket Error: Connection to Remita gateway refused.'}
    5356    resp = h.getresponse()
    5457    if resp.status!=200:
     
    7376    else:
    7477        h = httplib.HTTPConnection(host)
    75     h.request("GET", url, headers=headers)
     78    try:
     79        h.request("GET", url, headers=headers)
     80    except:
     81        return {'error': 'Socket Error: Connection to Remita gateway refused.'}
    7682    resp = h.getresponse()
    7783    if resp.status!=200:
Note: See TracChangeset for help on using the changeset viewer.