Exception: Colorly::ScriptError

Inherits:
Error
  • Object
show all
Defined in:
lib/colorly/exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error) ⇒ ScriptError

Returns a new instance of ScriptError.



10
11
12
13
14
15
# File 'lib/colorly/exceptions.rb', line 10

def initialize(error)
  @error = error
  trace = error.backtrace_locations.first
  message = error.message.gsub(/ for #<Colorly::Script.*>/, '')
  super "#{trace.path}:#{trace.lineno}: #{message}"
end

Instance Attribute Details

#errorObject (readonly)

Returns the value of attribute error.



8
9
10
# File 'lib/colorly/exceptions.rb', line 8

def error
  @error
end