marinasundstrom / CheckedExceptions

Enforce better exception handling in C#/.NET by ensuring exceptions are explicitly handled.
MIT License
7 stars 1 forks source link

Change diagnostic message THROW001 #35

Closed marinasundstrom closed 1 week ago

marinasundstrom commented 1 week ago

This analyzer can be used without ThrowsAttribute. You don't need to define or use it to take the benefit of the basic analysis.

The basic thing we want to signal is that you should handle exceptions, rather than propagate them.

To reflect this, we are changing the message of THROW001 from Exception '{0}' is thrown but not handled or declared via ThrowsAttribute to just Exception '{0}' is thrown but not handled.

This leads to preciseness.

It should be clear from using this analyzer that your need to declare corresponding ThrowsAttribute to propagate the warnings.

marinasundstrom commented 1 week ago

Done