Exception: JS::Error
- Inherits:
-
StandardError
- Object
- StandardError
- JS::Error
- Defined in:
- lib/js.rb,
ext/js/js-core.c
Overview
A wrapper class for JavaScript Error to allow the Error to be thrown in Ruby.
Instance Method Summary collapse
-
#initialize(exception) ⇒ Error
constructor
A new instance of Error.
- #message ⇒ Object
Constructor Details
#initialize(exception) ⇒ Error
Returns a new instance of Error.
282 283 284 285 |
# File 'lib/js.rb', line 282 def initialize(exception) @exception = exception super end |
Instance Method Details
#message ⇒ Object
287 288 289 290 291 292 293 294 295 |
# File 'lib/js.rb', line 287 def stack = @exception[:stack] if stack.typeof == "string" # Error.stack contains the error message also stack.to_s else @exception.to_s end end |