Exception: U2F::RegistrationError

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

Constant Summary collapse

CODES =
{
  1 => "OTHER_ERROR",
  2 => "BAD_REQUEST",
  3 => "CONFIGURATION_UNSUPPORTED",
  4 => "DEVICE_INELIGIBLE",
  5 => "TIMEOUT"
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ RegistrationError

Returns a new instance of RegistrationError.



26
27
28
29
30
# File 'lib/u2f/errors.rb', line 26

def initialize(options = {})
  @code = options[:code]
  message = options[:message] || "Token returned #{CODES[code]}"
  super(message)
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



24
25
26
# File 'lib/u2f/errors.rb', line 24

def code
  @code
end