aboutsummaryrefslogtreecommitdiffstats
path: root/python_moonutilities/python_moonutilities/request_wrapper.py
blob: 8cf5b99799f42b35c1253812c4df7acf1b34c107 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
import sys
import requests
from python_moonutilities import exceptions

def get(url):
    try:
        response = requests.get(url)
    except requests.exceptions.RequestException as e:
        raise exceptions.ConsulError("request failure ",e)
    except:
        raise exceptions.ConsulError("Unexpected error ", sys.exc_info()[0])
    return response