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

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

Constant Summary collapse

MESSAGE =
"An internal error occurred %s.\nUpdating to a newer version of RuboCop may solve this.\nFor more details, run RuboCop on the command line.\n"

Instance Method Summary collapse

Constructor Details

#initialize(rubocop_error) ⇒ InternalRuboCopError

Returns a new instance of InternalRuboCopError.



29
30
31
32
33
34
35
36
37
# File 'lib/ruby_lsp/requests/support/rubocop_runner.rb', line 29

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