Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Resharper (2016.1 C#) suggest exceptions to catch with a try catch block?

Can Resharper or an existing plugin for resharper suggest exceptions to catch with a try catch block?

For example, File.ReadAllText throws the following exceptions, are there any existing plugins that will allow resharper/intellisense to display these as I type the catch block?

enter image description here

edit: Added a link so you can vote for the resharper suggestion https://resharper-support.jetbrains.com/hc/en-us/community/posts/115000073730-Suggest-exceptions-to-catch-when-typing-try-catch-block

like image 602
rollsch Avatar asked Oct 30 '22 13:10

rollsch


1 Answers

Exceptional for ReSharper does something similar. It suggests exceptions to catch, not in IntelliSense, but when statically analyzing the code.

It is of course dependent upon the XML Documentation of all called methods to contain the possible exceptions thrown.

like image 87
Roy Dictus Avatar answered Nov 02 '22 10:11

Roy Dictus