Empty Catch Block Checker for C#
Find empty and swallowing catch blocks in C# with Roslyn syntax analysis.
Paste C# source to locate catch blocks that silently ignore failures. Uses Roslyn syntax analysis—not regular expressions.
Snippets are analyzed on demand and not saved to your profile.
Use cases
- Audit exception handling before production incidents.
- Teach why empty catch blocks hide failures.
- Copy suggested logging patterns into your editor.
Frequently asked questions
Should every method have try/catch?
No. Handle exceptions where you can recover or report; let others propagate to boundaries.
Are intentionally ignored exceptions flagged?
Some discard patterns may still warn—document why ignoring is safe when reviewing findings.
Which rule ID is used?
Empty blocks use CI0002; swallow-only handlers use CI0002-SWALLOW in this tool.
Related tools
Read the empty catch guide, then scan whole repos with CodeInspector.