Skip to content
19 changes: 10 additions & 9 deletions evalai/utils/submissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,17 @@ def make_submission(challenge_id, phase_id, file, submission_metadata={}):
except requests.exceptions.HTTPError as err:
if response.status_code in EVALAI_ERROR_CODES:
validate_token(response.json())
echo(
style(
"\nError: {}\n"
"\nUse `evalai challenges` to fetch the active challenges.\n"
"\nUse `evalai challenge CHALLENGE phases` to fetch the "
"active phases.\n".format(response.json()["error"]),
fg="red",
bold=True,
if "error" in response.json():
echo(
style(
"\nError: {}\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about:

"\nFailed to make submission with error: {}\n"

"\nUse `evalai challenges` to fetch the active challenges.\n"
"\nUse `evalai challenge CHALLENGE phases` to fetch the "
"active phases.\n".format(response.json().get("error")),
fg="red",
bold=True,
)
)
)
else:
echo(err)
if "input_file" in response.json():
Expand Down