Changeset 14736 for main


Ignore:
Timestamp:
1 Aug 2017, 04:28:35 (7 years ago)
Author:
Henrik Bettermann
Message:

Catch ValueError?.

File:
1 edited

Legend:

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

    r14735 r14736  
    5252    resp = h.getresponse()
    5353    jsonout = resp.read()
    54     parsed_json = json.loads(jsonout[6:-1])
     54    try:
     55        parsed_json = json.loads(jsonout[6:-1])
     56    except ValueError:
     57        return None
    5558    return parsed_json
    5659
     
    7073    resp = h.getresponse()
    7174    jsonout = resp.read()
    72     parsed_json = json.loads(jsonout)
     75    try:
     76        parsed_json = json.loads(jsonout)
     77    except ValueError:
     78        return None
    7379    return parsed_json
    7480
Note: See TracChangeset for help on using the changeset viewer.