KT.EMPTY_CATCH_BLOCK

Empty 'catch' block

Reports empty 'catch' blocks. Empty catch blocks indicate that an exception is ignored and not handled. In case exceptions are ignored intentionally, this should be made explicit by using the specified names in the allowedExceptionNameRegex.

Options

  • allowedExceptionNameRegex (default: _|(ignore|expected).*)

    Ignores exception types which match this regex

The content on this page is adapted from the Detekt Docs. Copyright ©2022 The Detekt Team. All rights reserved. https://detekt.dev/comments.html