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

Replace errors.Wrap to errors.WithStack #25

Merged
merged 1 commit into from
Feb 27, 2024

Conversation

michiomochi
Copy link
Contributor

エラー時にエラー構造体が持たない情報をメッセージに付与したいケース以外は errors.Wrap ではなく errors.WithStack を用いたほうがメッセージ部を書かなくてよく、かつstacktraceの可読性が上がるためそのようにします。
ref:
https://zenn.dev/nekoshita/articles/097e00c6d3d1c9#%E3%82%B9%E3%82%BF%E3%83%83%E3%82%AF%E3%83%88%E3%83%AC%E3%83%BC%E3%82%B9%E3%81%8C%E5%BF%85%E8%A6%81%E3%81%AA%E5%A0%B4%E5%90%88

@kanmu kanmu deleted a comment from notion-workspace bot Feb 27, 2024
Copy link
Contributor

@HayatoShiba HayatoShiba left a comment

Choose a reason for hiding this comment

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

ありがとうございます 🙏

@michiomochi
Copy link
Contributor Author

寿司ゆき:thanks

@michiomochi michiomochi merged commit 54c3d1b into master Feb 27, 2024
2 checks passed
@michiomochi michiomochi deleted the michiomochi/replace-to-withstack branch February 27, 2024 05:00
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.

2 participants