Domanda

When I was using ReSharper 6 or 7 I had this little nifty plugin that would tell me what exceptions a method could throw. It would ask me to catch them or document my method (XML documentation like /// <exception cref="ObjectDisposedException" />) it possibly (re)throws these exceptions. I think (not sure) this plugin was called Agent Johnson. Now I see this nice plugin isn't available for ReSharper 8.1, nor it seems like it is being developed actively.

Is there a setting in ReSharper 8.1 that can make sure most exceptions get caught in code?

Or is this one of those: the source is there... Use it if you like but nobody else in the .NET world cares (anymore) about exceptions? :-) Do we just catch them all?

È stato utile?

Soluzione

Sadly, no, there's nothing in ReSharper to help with this, mainly because without something like Java's checked exceptions, there's no reliable way of knowing what exceptions could be thrown by code, especially due to runtime conditions.

As for plugins, it looks like Agent Johnson hasn't been updated since 7.1. There's another plugin called Exceptional that might be useful. It's 8.0 only, but it's worth adding an issue on the codeplex site, see if the owner could update.

And since it's open source, you could try and update it yourself - remove the 8.0 SDK imports in the csproj, add a reference to the 8.1 SDK nuget and rebuild. There will be a number of compile errors due to changing APIs, but they should hopefully be not too tricky to sort out.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top