thetron/mongoid_token

View on GitHub
lib/mongoid/token/exceptions.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Mongoid
  module Token
    class Error < StandardError; end

    class CollisionRetriesExceeded < Error
      def initialize(resource = "unknown resource", attempts = "unspecified")
        @resource = resource
        @attempts = attempts
      end

      def to_s
        "Failed to generate unique token for #{@resource} after #{@attempts} attempts."
      end
    end
  end
end