Exception: RubyLsp::Requests::Support::InternalRuboCopError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/ruby_lsp/requests/support/rubocop_runner.rb

Constant Summary collapse

MESSAGE =
<<~EOS
  An internal error occurred %s.
  Updating to a newer version of RuboCop may solve this.
  For more details, run RuboCop on the command line.
EOS

Instance Method Summary collapse

Constructor Details

#initialize(rubocop_error) ⇒ InternalRuboCopError

: ((::RuboCop::ErrorWithAnalyzedFileLocation | StandardError) rubocop_error) -> void



42
43
44
45
46
47
48
49
50
# File 'lib/ruby_lsp/requests/support/rubocop_runner.rb', line 42

def initialize(rubocop_error)
  message = case rubocop_error
  when ::RuboCop::ErrorWithAnalyzedFileLocation
    format(MESSAGE, "for the #{rubocop_error.cop.name} cop")
  when StandardError
    format(MESSAGE, rubocop_error.message)
  end
  super(message)
end