Cloud-CV / Cloud-CV/evalai-cli
Abstracting the request pattern.
- Dominant language
- Python
- Stars
- 57
- Forks
- 70
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
Assessment
This issue has not been assessed yet.