pyupio / safety

Safety checks Python dependencies for known security vulnerabilities and suggests the proper remediations for vulnerabilities detected.
https://safetycli.com/product/safety-cli
MIT License
1.66k stars 141 forks source link

Handling requests exceptions with friendly error messages #338

Open yeisonvargasf opened 3 years ago

yeisonvargasf commented 3 years ago

This will add friendly error messages for the users of safety.

This covers requests exceptions: ConnectionError, Timeout and generic RequestException, also there is a handling for Bad HTTP codes with a custom message.

a few screenshots about how it looks:

Screen Shot 2021-02-23 at 2 14 24 PM Screen Shot 2021-02-23 at 2 15 15 PM Screen Shot 2021-02-23 at 2 16 04 PM
codecov[bot] commented 3 years ago

Codecov Report

Merging #338 (593b50a) into master (d8609b9) will decrease coverage by 0.47%. The diff coverage is 67.85%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #338      +/-   ##
==========================================
- Coverage   69.51%   69.03%   -0.48%     
==========================================
  Files           8        8              
  Lines         538      562      +24     
==========================================
+ Hits          374      388      +14     
- Misses        164      174      +10     
Impacted Files Coverage Δ
safety/cli.py 52.45% <10.00%> (-4.18%) :arrow_down:
safety/errors.py 100.00% <100.00%> (ø)
safety/safety.py 92.90% <100.00%> (-0.28%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d8609b9...593b50a. Read the comment docs.

harlekeyn commented 3 years ago

Yeison, could you please terminate all lines with a period?

For example: "Our engineers are working quickly to resolve the issue." instead of "Our engineers are working quickly to resolve the issue"

yeisonvargasf commented 3 years ago

"Our engineers are working quickly to resolve the issue"

Sure!