Cloud-CV / Cloud-CV/evalai-cli

[bug] Improper implementation of click causes errors while handling exceptions

Open
#232 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
57
Forks
70
PR merge metrics
No merged PRs in 30d

Description

Current behavior:
While displaying the errors, `click.style` is being called on the errors to make the colors consistent. However, this implementation is not correct as `click.style` does not support an `Exception` as an argument, hence it raises an error on its own. See this snap:
![cli-bug-error-formatting](https://user-images.githubusercontent.com/37668193/71540772-03ce8500-2975-11ea-8003-d28a3a32d4cd.PNG)

Expected:
The error message should be displayed. Like:
![cli-bug-working](https://user-images.githubusercontent.com/37668193/71540776-1e086300-2975-11ea-8786-b768b7f407bb.PNG)


Another option to still retain the styling and colors is to call `str()` on the errors first.
i.e.
```
echo(style(str(exception), ... ))
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.