Sha256: e264d42c4c39eddbf2797b3fb551486991c4ae22078700a82b75d6036f869196

Contents?: true

Size: 833 Bytes

Versions: 48

Compression:

Stored size: 833 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  # An Error exception is different from an Offense with severity 'error'
  # When this exception is raised, it means that RuboCop is unable to perform
  # a requested action (probably due to misconfiguration) and must stop
  # immediately, rather than carrying on
  class Error < StandardError; end

  class ValidationError < Error; end

  # A wrapper to display errored location of analyzed file.
  class ErrorWithAnalyzedFileLocation < Error
    def initialize(cause:, node:, cop:)
      @cause = cause
      @cop = cop
      @location = node.is_a?(RuboCop::AST::Node) ? node.loc : node
    end

    attr_reader :cause, :cop

    def line
      @location&.line
    end

    def column
      @location&.column
    end

    def message
      "cause: #{cause.inspect}"
    end
  end
end

Version data entries

48 entries across 37 versions & 6 rubygems

Version Path
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/rubocop-0.79.0/lib/rubocop/error.rb
rubocop-0.88.0 lib/rubocop/error.rb
rbhint-0.87.1.rc1 lib/rubocop/error.rb
rubocop-0.87.1 lib/rubocop/error.rb
rubocop-0.87.0 lib/rubocop/error.rb
rubocop-0.86.0 lib/rubocop/error.rb
files.com-1.0.1 vendor/bundle/ruby/2.5.0/gems/rubocop-0.85.1/lib/rubocop/error.rb
rbhint-0.85.1.rc2 lib/rubocop/error.rb
rbhint-0.85.1.rc1 lib/rubocop/error.rb
rubocop-0.85.1 lib/rubocop/error.rb
rbhint-0.8.5.rc1 lib/rubocop/error.rb
rubocop-0.85.0 lib/rubocop/error.rb
rubocop-0.84.0 lib/rubocop/error.rb
rubocop-ast-0.0.2 lib/rubocop/error.rb
rubocop-ast-0.0.1 lib/rubocop/error.rb
rubocop-0.83.0 lib/rubocop/error.rb
rubocop-0.82.0 lib/rubocop/error.rb
rubocop-0.81.0 lib/rubocop/error.rb
rubocop-0.80.1 lib/rubocop/error.rb
rubocop-0.80.0 lib/rubocop/error.rb