Exception: Wukong::Error

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

Overview

A common error class intended to be raised by code within Wukong or its plugins.

Instance Method Summary collapse

Constructor Details

#initialize(msg_or_error) ⇒ Error

Returns a new instance of Error.



26
27
28
29
30
31
32
# File 'lib/wukong.rb', line 26

def initialize msg_or_error
  if msg_or_error.respond_to?(:message) && msg_or_error.respond_to?(:backtrace)
    super([msg_or_error.message, msg_or_error.backtrace].compact.join("\n"))
  else
    super(msg_or_error)
  end
end