Cloud-CV / evalai-cli

:cloud: :rocket: Official EvalAI Command Line Tool
https://cli.eval.ai
BSD 3-Clause "New" or "Revised" License
55 stars 63 forks source link

Fixed #215 Added handling for token.json in get_token cmd and added show_stdout command #222

Open bitmaks opened 4 years ago

bitmaks commented 4 years ago

This will now ensure that the token.json file exists and has a valid token.

pushkalkatara commented 4 years ago

Hi @aaaakshat Nice work, can you post screenshots describing the resolution of this issue.

bitmaks commented 4 years ago

Hi @pushkalkatara, I've added a JSONDecodeError exception to test for simple json errors such as the file existing but being corrupt/empty. I've also added a KeyError exception in case the "token" key is not present in the token.json file.

Below is the screenshot showing an empty token.json file as well as a corrupt token.json file.

jsonHandling

pushkalkatara commented 4 years ago

@aaaakshat Can you please post the screenshot of get_token command.

bitmaks commented 4 years ago

Hi @pushkalkatara, I already posted the screenshots for this command, however, I've reattached the screenshot below along with a valid case.

image

validToken

pushkalkatara commented 4 years ago

@aaaakshat Nice work. can we be more specific with the error message for the user to understand? Like,

  1. When token.json is empty, we can remove displaying the DecodeError, rather display - Token file was found empty, Please set the token using the command evalai set_token <token>.
  2. When token.json contains invalid token: Token file is corrupt, please reset the token using the command evalai set_token <token>.