Exception: Plaid::PlaidAPIError

Inherits:
PlaidError
  • Object
show all
Defined in:
lib/plaid/errors.rb

Overview

Public: Base class for any error returned by the API

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error_type, error_code, error_message, display_message, request_id) ⇒ PlaidAPIError

Internal: Initialize an error with proper attributes.

error_type - A broad categorization of the error. error_code - The particular error code. error_message - A developer-friendly representation of the error

message.

display_message - A user-friendly representation of the error message. request_id - The ID of the request you made, can be used to

escalate problems.


22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/plaid/errors.rb', line 22

def initialize(error_type, error_code, error_message, display_message,
               request_id)
  @error_type      = error_type
  @error_code      = error_code
  @error_message   = error_message
  @display_message = display_message
  @request_id      = request_id

  super <<-TEXT

Error Type      : #{error_type}
Error Code      : #{error_code}
Error Message   : #{error_message}
Display Message : #{display_message}
Request ID      : #{request_id}
TEXT
end

Instance Attribute Details

#display_messageObject (readonly)

Returns the value of attribute display_message.



10
11
12
# File 'lib/plaid/errors.rb', line 10

def display_message
  @display_message
end

#error_codeObject (readonly)

Returns the value of attribute error_code.



10
11
12
# File 'lib/plaid/errors.rb', line 10

def error_code
  @error_code
end

#error_messageObject (readonly)

Returns the value of attribute error_message.



10
11
12
# File 'lib/plaid/errors.rb', line 10

def error_message
  @error_message
end

#error_typeObject (readonly)

Returns the value of attribute error_type.



10
11
12
# File 'lib/plaid/errors.rb', line 10

def error_type
  @error_type
end

#request_idObject (readonly)

Returns the value of attribute request_id.



10
11
12
# File 'lib/plaid/errors.rb', line 10

def request_id
  @request_id
end