evalai-cli
evalai-cli copied to clipboard
Abstracting the request pattern.
Currently, most of the request function use the same format of http request pattern except a few.
headers = get_request_header()
try:
response = requests.get(url, headers=headers)
response.raise_for_status()
except requests.exceptions.HTTPError as err:
if (response.status_code in EVALAI_ERROR_CODES):
validate_token(response.json())
echo(style("Error: {}".format(response.json()["error"]), fg="red", bold=True))
else:
echo(err)
sys.exit(1)
except requests.exceptions.RequestException as err:
echo(err)
sys.exit(1)
This could be simplified easily by abstracting this functionality as a function.
@isht3 @RishabhJain2018 Can I work on this issue?
@mahim23 Sure! Once you've completed your previous issue then you can work on this. Till then it is open for others to work on.