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

例外の再スロー時に stack trace が消えてしまう問題を修正 #134

Merged
merged 1 commit into from
Nov 28, 2021

Conversation

runceel
Copy link
Contributor

@runceel runceel commented Nov 25, 2021

C# の例外処理の catch 句で例外を再スローする場合は throw exception; ではなく単純に throw; と記載します。
throw exception; をすると例外のスタック トレースが、この行からになってしまい元々例外が発生した場所のスタック トレースが消えてしまいます。

https://docs.microsoft.com/ja-jp/dotnet/fundamentals/code-analysis/quality-rules/ca2200

@keiji keiji self-requested a review November 26, 2021 01:45
Copy link
Owner

@keiji keiji left a comment

Choose a reason for hiding this comment

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

ありがとうございます!
マージします!

@keiji keiji merged commit 17209f1 into keiji:master Nov 28, 2021
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