gocryptotrader icon indicating copy to clipboard operation
gocryptotrader copied to clipboard

common: add function ErrorWithContext

Open shazbert opened this issue 1 year ago • 1 comments

PR Description

Adds verbose output to error using runtime package information.

Please delete options that are not relevant and add an x in [] as item is complete.

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] This change requires a documentation update

How has this been tested

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration and also consider improving test coverage whilst working on a certain feature or package.

  • [ ] go test ./... -race
  • [ ] golangci-lint run
  • [ ] Test X

Checklist

  • [ ] My code follows the style guidelines of this project
  • [ ] I have performed a self-review of my own code
  • [ ] I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation and regenerated documentation via the documentation tool
  • [ ] My changes generate no new warnings
  • [ ] I have added tests that prove my fix is effective or that my feature works
  • [ ] New and existing unit tests pass locally and on Github Actions with my changes
  • [ ] Any dependent changes have been merged and published in downstream modules

shazbert avatar Jun 14 '24 03:06 shazbert

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 36.30%. Comparing base (98f025e) to head (390406d). Report is 2 commits behind head on master.

:exclamation: Current head 390406d differs from pull request most recent head 977edd8

Please upload reports for the commit 977edd8 to get more accurate results.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1567      +/-   ##
==========================================
+ Coverage   36.26%   36.30%   +0.03%     
==========================================
  Files         419      419              
  Lines      183133   183151      +18     
==========================================
+ Hits        66421    66488      +67     
+ Misses     108605   108568      -37     
+ Partials     8107     8095      -12     
Files Coverage Δ
common/common.go 95.02% <100.00%> (+1.01%) :arrow_up:

... and 20 files with indirect coverage changes

codecov[bot] avatar Jun 14 '24 03:06 codecov[bot]

Opted to not introduce code that is not integrated into library and never will be. Will open a PR to assign at the logger level if the the caller functionality is needed.

shazbert avatar Jul 28 '24 23:07 shazbert