Exception: WLang::EvalError
- Inherits:
-
Error
- Object
- StandardError
- Error
- WLang::EvalError
- Defined in:
- lib/wlang/errors.rb
Overview
Raised by hosted languages when something fails during evaluation.
Direct Known Subclasses
Instance Attribute Summary (collapse)
-
- (Object) expression
The expression whose evaluation failed.
Attributes inherited from Error
Instance Method Summary (collapse)
-
- (EvalError) initialize(msg = nil, parser_state = nil, expression = nil, cause = nil)
constructor
Creates an error instance with an optional expression that failed.
- - (Object) to_s
Methods inherited from Error
Constructor Details
- (EvalError) initialize(msg = nil, parser_state = nil, expression = nil, cause = nil)
Creates an error instance with an optional expression that failed
40 41 42 43 |
# File 'lib/wlang/errors.rb', line 40 def initialize(msg = nil, parser_state = nil, expression = nil, cause = nil) super(msg, parser_state, cause) @expression = expression end |
Instance Attribute Details
- (Object) expression
The expression whose evaluation failed
36 37 38 |
# File 'lib/wlang/errors.rb', line 36 def expression @expression end |
Instance Method Details
- (Object) to_s
45 46 47 |
# File 'lib/wlang/errors.rb', line 45 def to_s "Evaluation of #{@expression} failed, #{@cause ? @cause. : ''}" end |