def parse(resp):
    """Decode HTTP response to JSON"""
    try:
        resp = resp.json()
    except ValueError as error:
        raise RuntimeError('Decoding JSON has failed') from error
    if 'statusCode' in resp or 'status-code' in resp or 'error' in resp:
        raise RuntimeError(resp) # 'error' in resp seems appear with RPC only
    return resp