Exception: Finicity::GenericError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/finicity/errors.rb

Direct Known Subclasses

AuthenticationError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error_message = nil, http_status = nil, finicity_code = nil) ⇒ GenericError

Returns a new instance of GenericError.



5
6
7
8
9
# File 'lib/finicity/errors.rb', line 5

def initialize(error_message = nil, http_status = nil, finicity_code = nil)
  @error_message = error_message
  @http_status = http_status
  @finicity_code = finicity_code
end

Instance Attribute Details

#error_messageObject (readonly)

Returns the value of attribute error_message.



3
4
5
# File 'lib/finicity/errors.rb', line 3

def error_message
  @error_message
end

#finicity_codeObject (readonly)

Returns the value of attribute finicity_code.



3
4
5
# File 'lib/finicity/errors.rb', line 3

def finicity_code
  @finicity_code
end

#http_statusObject (readonly)

Returns the value of attribute http_status.



3
4
5
# File 'lib/finicity/errors.rb', line 3

def http_status
  @http_status
end

Instance Method Details

#to_sObject



11
12
13
14
15
# File 'lib/finicity/errors.rb', line 11

def to_s
  status = http_status.nil? ? "" : "[Status #{http_status}] "
  code = finicity_code.nil? ? "" : "[Finicity Code #{finicity_code}] "
  "#{status}#{code}#{error_message}"
end