Exception: DPay::ApiError

Inherits:
StandardError
  • Object
show all
Includes:
Error
Defined in:
lib/dpay/errors.rb,
sig/dpay/errors.rbs

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, http_status, error_code = nil, field_errors = {}, raw_body = "") ⇒ ApiError

Returns a new instance of ApiError.



27
28
29
30
31
32
33
# File 'lib/dpay/errors.rb', line 27

def initialize(message, http_status, error_code = nil, field_errors = {}, raw_body = "")
  super(message)
  @http_status = http_status
  @error_code = error_code
  @field_errors = field_errors
  @raw_body = raw_body
end

Instance Attribute Details

#error_codeString? (readonly)

Returns the value of attribute error_code.

Returns:

  • (String, nil)


25
26
27
# File 'lib/dpay/errors.rb', line 25

def error_code
  @error_code
end

#field_errorsHash[String, Array[String]] (readonly)

Returns the value of attribute field_errors.

Returns:

  • (Hash[String, Array[String]])


25
26
27
# File 'lib/dpay/errors.rb', line 25

def field_errors
  @field_errors
end

#http_statusInteger (readonly)

Returns the value of attribute http_status.

Returns:

  • (Integer)


25
26
27
# File 'lib/dpay/errors.rb', line 25

def http_status
  @http_status
end

#raw_bodyString (readonly)

Returns the value of attribute raw_body.

Returns:

  • (String)


25
26
27
# File 'lib/dpay/errors.rb', line 25

def raw_body
  @raw_body
end