Exception: Lookbook::LookbookError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/lookbook/support/errors/lookbook_error.rb

Direct Known Subclasses

ConfigError, ParserError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg = nil, scope: nil, original: nil) ⇒ LookbookError

Returns a new instance of LookbookError.



5
6
7
8
9
10
# File 'lib/lookbook/support/errors/lookbook_error.rb', line 5

def initialize(msg = nil, scope: nil, original: nil)
  @scope = scope
  @original = original
  @message = msg
  super(msg)
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



3
4
5
# File 'lib/lookbook/support/errors/lookbook_error.rb', line 3

def message
  @message
end

#originalObject (readonly)

Returns the value of attribute original.



3
4
5
# File 'lib/lookbook/support/errors/lookbook_error.rb', line 3

def original
  @original
end

#scopeObject (readonly)

Returns the value of attribute scope.



3
4
5
# File 'lib/lookbook/support/errors/lookbook_error.rb', line 3

def scope
  @scope
end

Instance Method Details

#full_messageObject



12
13
14
15
16
17
18
19
# File 'lib/lookbook/support/errors/lookbook_error.rb', line 12

def full_message
  if msg.nil?
    message
  else
    scope_str = scope.nil? ? "[#{scope}]" : ""
    "#{scope_str} #{message}".strip
  end
end