Last active
July 14, 2016 08:03
-
-
Save jeroenheijmans/6c3507b7ef8e55d8ca3646950710fb37 to your computer and use it in GitHub Desktop.
RegEx for bad Rethrows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This regex is a basic check to find all Catch{} blocks | |
// where a suspect throw statement is found (e.g. a state- | |
// ment that mucks up the call stack by doing `throw ex;` | |
// instead of `throw;`. | |
// | |
// It'll probably give false positives and have misses too. | |
catch[^{]*\{[^{]*throw[^;][^}]*} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment