2022-Spring-NYU-DevOps-Shopcarts / shopcarts

Shopcarts squad.
Apache License 2.0
2 stars 2 forks source link

refactoring #120

Closed kdokm closed 2 years ago

kdokm commented 2 years ago

Professor said that we do not need to have error_handler.py at the end, since restx will handle most errors. I found that it is true but it behaves a little bit different from the error_handler.py, as the string in the 'message' field will not have a prefix showing the error code by default.

Because it is just parts of refactoring, error_handler.py is kept. The test coverage decreases because refactoring code doesn't go to error_handler.py.

In addition, I found the line printed in nosetests is because the log level is critical for that error. @TimothyXu

codecov-commenter commented 2 years ago

Codecov Report

Merging #120 (55e678e) into main (f338b49) will decrease coverage by 1.61%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #120      +/-   ##
==========================================
- Coverage   98.94%   97.33%   -1.62%     
==========================================
  Files           7        7              
  Lines         380      413      +33     
==========================================
+ Hits          376      402      +26     
- Misses          4       11       +7     
Impacted Files Coverage Δ
service/models.py 100.00% <100.00%> (ø)
service/routes.py 100.00% <100.00%> (ø)
service/utils/error_handlers.py 78.78% <0.00%> (-21.22%) :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 f338b49...55e678e. Read the comment docs.

TimothyXu commented 2 years ago

Thank you for doing this whole story and thank you for solving my question! Will add 'delete error_handler.py' to the remaining refactoring story.