evalai-cli icon indicating copy to clipboard operation
evalai-cli copied to clipboard

Fix #106: Display error message while submitting when user doesn't participate in a challenge

Open hkmatsumoto opened this issue 5 years ago • 4 comments

Fix #106

The corresponding GCI task

Changes:

  • Add lines to display an error message when a user submitting to the challenge s/he doesn't participate.

@vkartik97 @pushkalkatara Could you take a look? Thanks in advance!

hkmatsumoto avatar Jan 16 '20 13:01 hkmatsumoto

Brief explanation of the logic of this code lines: When a user submits to the challenges s/he doesn't participate using cli, these lines in EvalAI will be called and

{"error": "You haven't participated in the challenge"}

is returned with 403 status code.

Thus, to detect the error I check if the returned status code equals to 403, and if so print the ["error"] of the returned json which is "You haven't participated in the challenge", as you see in the json code above.

hkmatsumoto avatar Jan 16 '20 14:01 hkmatsumoto

Screencast: Screenshot from 2020-01-16 23-36-35

hkmatsumoto avatar Jan 16 '20 14:01 hkmatsumoto

LGTM 👍

yashdusing avatar Jan 17 '20 14:01 yashdusing

@yashdusing Thanks! Can I also get my task approved?

hkmatsumoto avatar Jan 17 '20 15:01 hkmatsumoto