Exception: Idl::AstNode::TypeError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/idl/ast.rb

Overview

error that is thrown when compilation reveals a type error

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(what) ⇒ TypeError

Returns a new instance of TypeError.

Parameters:

  • what (String)

    Error message



92
93
94
95
96
97
98
99
100
101
# File 'lib/idl/ast.rb', line 92

def initialize(what)
  super(what)

  @what = what
  @bt = Kernel.caller

  # shift twice to get to the call site of 'type_error'
  @bt.shift
  @bt.shift
end

Instance Attribute Details

#btArray<String> (readonly)

The backtrace starting from the ‘type_error’ call site

Note, this will be different (truncated) from #backtrace

Returns:

  • (Array<String>)

    The compiler backtrace at the error point



89
90
91
# File 'lib/idl/ast.rb', line 89

def bt
  @bt
end

#whatString (readonly)

Returns The error message.

Returns:

  • (String)

    The error message



82
83
84
# File 'lib/idl/ast.rb', line 82

def what
  @what
end