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

Improve "more specific exception" and "exception should only be thrown by the CLR" warnings #4

Open
zwitbaum opened this issue Feb 3, 2016 · 2 comments

Comments

@zwitbaum
Copy link

zwitbaum commented Feb 3, 2016

Please show the warning message "A more specific exception should be used." as well as the "The exception should only be thrown by the CLR" only for exceptions described in the rule CA2201: Do not raise reserved exception types.

Please add an information to the rule, e.g. " (CA2201)" to the warning message to provide more information for reason of the warning.

For other non-specific exception types like e.g. WarningException please show a hint message to suggest the user to throw a more specific exception like described in CA2201.

@zwitbaum zwitbaum changed the title Improve analyze for "more specific exception" warning Improve "more specific exception" and "exception should only be thrown by the CLR" warnings Feb 3, 2016
@NN---
Copy link

NN--- commented Feb 4, 2021

Updated documentation link: CA2201: Do not raise reserved exception types

@michael-damatov
Copy link
Collaborator

Updated analyzer for "unthrowable" exception (two exceptions were missing). This will be part of the next minor release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants