Exception: FabricCA::Error

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, response) ⇒ Error

Returns a new instance of Error.



5
6
7
8
9
10
# File 'lib/fabric_ca/error.rb', line 5

def initialize(message, response)
  super message

  @response = Hashie::Mash.new JSON.parse(response.body)
  @full_message = @response.errors.map(&:message).join(', ')
end

Instance Attribute Details

#full_messageObject (readonly)

Returns the value of attribute full_message.



3
4
5
# File 'lib/fabric_ca/error.rb', line 3

def full_message
  @full_message
end

#responseObject (readonly)

Returns the value of attribute response.



3
4
5
# File 'lib/fabric_ca/error.rb', line 3

def response
  @response
end