Exception: Keychain::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Keychain::Error
- Defined in:
- lib/keychain/error.rb
Overview
The base class of all keychain related errors
The original error code is available as ‘code`
Direct Known Subclasses
AuthFailedError, DuplicateItemError, InteractionNotAllowedError, NoSuchKeychainError, UserCancelledError
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
Instance Method Summary collapse
-
#initialize(code) ⇒ Error
constructor
A new instance of Error.
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
#code ⇒ Object
Returns the value of attribute code.
10 11 12 |
# File 'lib/keychain/error.rb', line 10 def code @code end |