Exception: Grac::Exception::InvalidContent

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

Instance Method Summary collapse

Constructor Details

#initialize(body, type) ⇒ InvalidContent

Returns a new instance of InvalidContent.



58
59
60
61
# File 'lib/grac/exception.rb', line 58

def initialize(body, type)
  @body = body
  @type = type
end

Instance Method Details

#inspectObject



67
68
69
# File 'lib/grac/exception.rb', line 67

def inspect
  "#{self.class.name}: #{message}"
end

#messageObject Also known as: to_s



63
64
65
# File 'lib/grac/exception.rb', line 63

def message
  "Failed to parse body as '#{@type}': '#{@body}'"
end