A module that provides utilities for errors.

Sections
Methods
E
Constants
ERROR_TYPE_MAP = { 'INVALID_REQUEST' => Plaid::InvalidRequestError, 'INVALID_INPUT' => Plaid::InvalidInputError, 'RATE_LIMIT_EXCEEDED' => Plaid::RateLimitExceededError, 'API_ERROR' => Plaid::APIError, 'ITEM_ERROR' => Plaid::ItemError, 'INSTITUTION_ERROR' => Plaid::InstitutionError }.freeze
 
Internal
Class Public methods
error_from_type(error_type)

Map error_type to PlaidAPIError.

Maps an error_type from an error HTTP response to an actual PlaidAPIError class instance.

error_type

The type of the error as indicated by the error response body.

Returns

Returns an error class mapped from error_type.

# File lib/plaid/errors.rb, line 85
def self.error_from_type(error_type)
  ERROR_TYPE_MAP[error_type] || Plaid::PlaidAPIError
end