CredoExceptionSwallow.Checks.Warning.LoggedAndDroppedError (CredoExceptionSwallow v0.3.0)
View SourceBasics
This check is disabled by default.
Learn how to enable it via .credo.exs.
This check has a base priority of high and works with any version of Elixir.
Explanation
An error branch that logs a warning and then returns a value indistinguishable
from success makes the failure invisible: the batch reports {:ok, stats}, the
row is gone, and the only trace is a log line nobody reads.
Either report it, raise, or propagate the error to the caller.
Check-Specific Parameters
Use the following parameters to configure this check:
:skip_test_files
Whether to skip test files (default: true)
This parameter defaults to true.
:log_calls
Log calls that mark the branch as a failure worth recording
This parameter defaults to ["Logger.warning", "Logger.warn", "Logger.error"].
:propagating_calls
Calls that hand the failure on without error monitoring
This parameter defaults to [].
:reporting_calls
Calls that count as reporting the failure
This parameter defaults to ["ErrorReporter.report", "ErrorReporter.report_message", "ErrorReporter.report_warning", "ErrorReporter.report_exception", "Sentry.capture_exception", "Sentry.capture_message", "Appsignal.send_error", "Honeybadger.notify", "Rollbax.report"].
General Parameters
Like with all checks, general params can be applied.
Parameters can be configured via the .credo.exs config file.