Exception: RBI::UnexpectedParserError

Inherits:
Error
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/rbi/parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent_exception, last_location) ⇒ UnexpectedParserError

Returns a new instance of UnexpectedParserError.



27
28
29
30
31
# File 'lib/rbi/parser.rb', line 27

def initialize(parent_exception, last_location)
  super(parent_exception)
  set_backtrace(parent_exception.backtrace)
  @last_location = last_location
end

Instance Attribute Details

#last_locationObject (readonly)

Returns the value of attribute last_location.



24
25
26
# File 'lib/rbi/parser.rb', line 24

def last_location
  @last_location
end

Instance Method Details



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/rbi/parser.rb', line 34

def print_debug(io: $stderr)
  io.puts ""
  io.puts "##################################"
  io.puts "### RBI::Parser internal error ###"
  io.puts "##################################"
  io.puts ""
  io.puts "There was an internal parser error while processing this source."
  io.puts ""
  io.puts "Error: #{message} while parsing #{last_location}:"
  io.puts ""
  io.puts last_location.source || "<no source>"
  io.puts ""
  io.puts "Please open an issue at https://github.com/Shopify/rbi/issues/new."
  io.puts ""
  io.puts "##################################"
  io.puts ""
end