1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
module GPGME
class Error < StandardError
def initialize(error)
@error = error
end
attr_reader :error
# Return the error code.
#
# The error code indicates the type of an error, or the reason why
# an operation failed.
def code
GPGME::gpgme_err_code(@error)
end
# Return the error source.
#
# The error source has not a precisely defined meaning. Sometimes
# it is the place where the error happened, sometimes it is the
# place where an error was encoded into an error value. Usually
# the error source will give an indication to where to look for
# the problem. This is not always true, but it is attempted to
# achieve this goal.
def source
GPGME::gpgme_err_source(@error)
end
# Return a description of the error code.
def message
GPGME::gpgme_strerror(@error)
end
class General < self; end
class InvalidValue < self; end
class UnusablePublicKey < self
attr_accessor :keys
end
class UnusableSecretKey < self
attr_accessor :keys
end
class NoData < self; end
class Conflict < self; end
class NotImplemented < self; end
class DecryptFailed < self; end
class BadPassphrase < self; end
class Canceled < self; end
class InvalidEngine < self; end
class AmbiguousName < self; end
class WrongKeyUsage < self
attr_accessor :key_usage
end
class CertificateRevoked < self; end
class CertificateExpired < self; end
class NoCRLKnown < self; end
class NoPolicyMatch < self; end
class NoSecretKey < self; end
class MissingCertificate < self; end
class BadCertificateChain < self; end
class UnsupportedAlgorithm < self
attr_accessor :algorithm
end
class BadSignature < self; end
class NoPublicKey < self; end
class InvalidVersion < self; end
end
end
|