Exception: Keychain::Error

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

Overview

The base class of all keychain related errors

The original error code is available as ‘code`

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code) ⇒ Error

Returns a new instance of Error.



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

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.



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

def code
  @code
end