It is reported for both throw statements and members.
Problem
The confusion might be in that members (such as methods) are not certain to throw. They might just potentially throw the exceptions reported. So the statement that it "throws" is false.
Idea
This leads us to think; Should the message adapt, or should be a separate error code?
Exception “{0}” is thrown but not handled
Exception “{0}” might be thrown but not handled
Solution
We can control this with parameters to diagnostics:
Exception “{0}” {1} thrown but not handled
With the argument replacing {1} either being "is" or "might be".
Effort
After investigating:
Downside is that we need to fix all tests and make them take that parameter. And that might actually be a benefit in distinguishing the cases between "throw" and methods propagating errors.
Currently the
THROW001
message is this:Exception “{0}” is thrown but not handled
It is reported for both
throw
statements and members.Problem
The confusion might be in that members (such as methods) are not certain to throw. They might just potentially throw the exceptions reported. So the statement that it "throws" is false.
Idea
This leads us to think; Should the message adapt, or should be a separate error code?
Exception “{0}” is thrown but not handled
Exception “{0}” might be thrown but not handled
Solution
We can control this with parameters to diagnostics:
Exception “{0}” {1} thrown but not handled
With the argument replacing
{1}
either being"is"
or"might be"
.Effort
After investigating:
Downside is that we need to fix all tests and make them take that parameter. And that might actually be a benefit in distinguishing the cases between "throw" and methods propagating errors.