Exception: TokenizeAttr::RetryExceededError

Inherits:
Error
  • Object
show all
Defined in:
lib/tokenize_attr/errors.rb

Overview

Raised when a unique token cannot be generated within the configured number of retries.

Examples:

begin
  MyModel.create!
rescue TokenizeAttr::RetryExceededError => e
  Rails.logger.error(e.message)
end

Instance Method Summary collapse

Constructor Details

#initialize(attribute, retries) ⇒ RetryExceededError

Returns a new instance of RetryExceededError.

Parameters:

  • attribute (Symbol, String) —

    the attribute that failed to tokenize

  • retries (Integer) —

    the number of attempts that were made



19
20
21
# File 'lib/tokenize_attr/errors.rb', line 19

def initialize(attribute, retries)
  super("Could not generate a unique token for :#{attribute} after #{retries} retries")
end