interledger-deprecated / five-bells-shared

Common elements that are shared between Five Bells components
Other
4 stars 5 forks source link

feat: make errors more declarative #194

Closed justmoon closed 7 years ago

justmoon commented 7 years ago

By adding a status property we can get rid of most of the custom errors handlers.

This PR is a stepping stone in a long-standing quest to get rid of five-bells-shared in favor of more widely used modules created by the Node community.

codecov-io commented 7 years ago

Codecov Report

Merging #194 into master will increase coverage by 4.25%. The diff coverage is 17.64%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #194      +/-   ##
==========================================
+ Coverage   53.73%   57.98%   +4.25%     
==========================================
  Files          23       19       -4     
  Lines         750      676      -74     
  Branches      125      113      -12     
==========================================
- Hits          403      392      -11     
+ Misses        347      284      -63
Impacted Files Coverage Δ
errors/already-exists-error.js 40% <0%> (+6.66%) :arrow_up:
errors/unprocessable-entity-error.js 40% <0%> (+6.66%) :arrow_up:
errors/not-found-error.js 40% <0%> (+6.66%) :arrow_up:
errors/unmet-condition-error.js 40% <0%> (+6.66%) :arrow_up:
errors/unauthorized-error.js 33.33% <0%> (+11.11%) :arrow_up:
errors/server-error.js 100% <100%> (+66.66%) :arrow_up:

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 60d8f35...da02238. Read the comment docs.

justmoon commented 7 years ago

Good point, added a note in the commit message.