KogenCredo.Check.Warning.BroadRescue (KogenCredo v0.1.0)
View SourceBasics
This check is disabled by default.
Learn how to enable it via .credo.exs.
This check has a base priority of low and works with any version of Elixir.
Explanation
Rescuing every exception launders bugs (FunctionClauseError, KeyError, a typo) into a
value and hides defects from supervisors and tests. Rescue the specific exception at the
I/O edge (rescue e in File.Error) and return a typed {:error, reason}, or let it crash.
Check-Specific Parameters
Use the following parameters to configure this check:
:broad_exceptions
Exception modules treated as 'any exception'.
This parameter defaults to [Exception, RuntimeError, ErlangError].
:included_paths
Only files under these path prefixes are checked.
This parameter defaults to ["lib/"].
:excluded_paths
Files under these path prefixes are skipped.
This parameter defaults to [].
General Parameters
Like with all checks, general params can be applied.
Parameters can be configured via the .credo.exs config file.