Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark unsafe for Lint/RaiseException cop #8178

Merged
merged 1 commit into from Jun 21, 2020

Commits on Jun 21, 2020

  1. Mark unsafe for Lint/RaiseException cop

    Follow up rubocop#8169 (comment).
    
    `Lint/RaiseException` cop is unsafe due to incompatibility
    between bad and good cases.
    
    ## bad case
    
    ```console
    % cat /tmp/example_for_exception.rb
    begin
      raise Exception
    rescue
      puts 'Handle exception'
    end
    
    % ruby example_for_exception.rb
    example_for_exception.rb:2:in `<main>': Exception (Exception)
    ```
    
    ## good case
    
    ```console
    % cat example_for_starndard_error.rb
    begin
      raise StandardError
    rescue
      puts 'Handle exception'
    end
    
    % ruby /tmp/example_for_starndard_error.rb
    Handle exception
    ```
    koic committed Jun 21, 2020
    Copy the full SHA
    d6c1b12 View commit details
    Browse the repository at this point in the history