Exception: NodeTask::Error

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(original_js_error) ⇒ Error

Returns a new instance of Error.



14
15
16
17
18
# File 'lib/node_task/node_task.rb', line 14

def initialize(original_js_error)
  @js_error = original_js_error

  super(@js_error ? @js_error[:message] : nil)
end

Instance Attribute Details

#js_errorObject

Returns the value of attribute js_error.



12
13
14
# File 'lib/node_task/node_task.rb', line 12

def js_error
  @js_error
end

Instance Method Details

#to_sObject



20
21
22
23
24
# File 'lib/node_task/node_task.rb', line 20

def to_s
  return super unless @js_error

  @js_error[:stack] || @js_error[:message]
end