Skip to content

Add a new cop to detect suppress(Exception) (just like Lint/RescueException does) #1547

@viralpraxis

Description

@viralpraxis

Is your feature request related to a problem? Please describe.

There's a Lint/RescueException core cop which flags this code:

begin
rescue Exception => e
  ??
end

I think it makes sense to do the same for ActiveSupport's Kernel.suppress(Exception).

Describe the solution you'd like

Add a new cop Rails/SuppressException to detect rescuing Exception class.

Describe alternatives you've considered

Adding support for custom methods in the Lint/RescueException itself?

Additional context

If that makes sense, I'd like to implement it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions