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



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

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



87
88
89
# File 'lib/idl/ast.rb', line 87

def bt
  @bt
end

#whatString (readonly)

Returns The error message.

Returns:

  • (String)

    The error message



80
81
82
# File 'lib/idl/ast.rb', line 80

def what
  @what
end