Sha256: 5fa985bd1fcce27449c26308201c90456534dc7045d6fd56b986dfb394d98aff
Contents?: true
Size: 1.33 KB
Versions: 6
Compression:
Stored size: 1.33 KB
Contents
module Sec attach_function 'SecCopyErrorMessageString', [:osstatus, :pointer], :pointer end # The base class of all keychain related errors # # The original error code is available as `code` class Keychain::Error < StandardError attr_accessor :code 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 end # Raised when saving or updating an item # fails because an existing item is already in the keychain class Keychain::DuplicateItemError < Keychain::Error; end # Raised when an operation that requires a password fails, # for example unlocking a keychain class Keychain::AuthFailedError < Keychain::Error; end # Raised when an action that requires user interaction # (such as decrypting as password) is cancelled by the user class Keychain::UserCancelledError < Keychain::Error; end # Raised when an action fails because the underlying keychain # does not exist class Keychain::NoSuchKeychainError < Keychain::Error; end # Raised when an action would rewuire user interaction but user interaction # is not allowed. See Keychain.user_interaction_allowed= class Keychain::InteractionNotAllowedError < Keychain::Error; end
Version data entries
6 entries across 6 versions & 1 rubygems