Exception: Idl::AstNode::InternalError

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

Overview

error that is thrown when the compiler hits an unrecoverable error (that needs fixed!)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(what) ⇒ InternalError

Returns a new instance of InternalError.



114
115
116
117
118
119
120
121
122
123
# File 'lib/idl/ast.rb', line 114

def initialize(what)
  super(what)

  @what = what
  @bt = Kernel.caller

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

Instance Attribute Details

#btArray<String> (readonly)

The backtrace starting from the ‘internal_error’ call site

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

Returns:

  • (Array<String>)

    The compiler backtrace at the error point



112
113
114
# File 'lib/idl/ast.rb', line 112

def bt
  @bt
end

#whatString (readonly)

Returns The error message.

Returns:

  • (String)

    The error message



105
106
107
# File 'lib/idl/ast.rb', line 105

def what
  @what
end