Exception: Keychain::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/keychain/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code) ⇒ Error

Returns a new instance of Error.



12
13
14
15
16
17
18
19
20
21
# File 'lib/keychain/error.rb', line 12

def initialize(code)
  self.code = code
  description = Sec.SecCopyErrorMessageString(code, nil)
  if description.null?
    super("Sec Error #{code}")
  else
    description = CF::Base.typecast(description)
    super("#{description.to_s} (#{code})")
  end
end

Instance Attribute Details

#codeObject

Returns the value of attribute code.



11
12
13
# File 'lib/keychain/error.rb', line 11

def code
  @code
end