Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add PassThrough method to pass on the code and properties #29

Merged
merged 2 commits into from
Aug 19, 2024

Conversation

Gogomoe
Copy link
Collaborator

@Gogomoe Gogomoe commented Jul 26, 2024

What's changed and what's your intention?

eris.PassThrough is almost like eris.Wrap, but it will copy the original error code and properties. (looks like only add a new message)
Therefore, we can use eris.PassThrough when we want to add an additional message but don't want to override the underlying status. (e.g. pass through the error in modeltx.Query)

I guess this method will have lots of use cases. So the function name eris.PassThrough seems a bit long. And idea? eris.Pass?

Checklist

  • I have written the necessary docs and comments
  • I have added necessary unit tests and integration tests

Refer to a related PR or issue link (optional)

@Gogomoe Gogomoe requested review from wjf3121, CAJan93 and xuhui-lu July 26, 2024 07:19
Copy link

codecov bot commented Jul 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.01%. Comparing base (78185bb) to head (9ba21be).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #29      +/-   ##
==========================================
+ Coverage   86.74%   88.01%   +1.26%     
==========================================
  Files           4        4              
  Lines         596      609      +13     
==========================================
+ Hits          517      536      +19     
+ Misses         73       68       -5     
+ Partials        6        5       -1     
Flag Coverage Δ
unittests 88.01% <100.00%> (+1.26%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@wjf3121 wjf3121 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I like this idea, good stuff!

@lukeraphael
Copy link

This is very useful, there were several times where I wish we had this function. About naming - how about extend? 😆

@Gogomoe Gogomoe merged commit 32ddf1e into main Aug 19, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants