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.



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

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

Instance Method Details

#inspectObject



73
74
75
# File 'lib/grac/exception.rb', line 73

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

#messageObject Also known as: to_s



69
70
71
# File 'lib/grac/exception.rb', line 69

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