diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-01-25 20:56:26 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-01-25 20:56:26 +0000 |
commit | 422eaae5fe0038ad189b8fd28cfd6a7094d67ae1 (patch) | |
tree | c68d6b2a9f5b82a23171b0a488a4b7e5c63ad860 /libgo/go/crypto/openpgp/errors/errors.go | |
parent | e0f3ea3ed4b9d0bce9f4c14762e4257ba62c8fba (diff) | |
download | ppe42-gcc-422eaae5fe0038ad189b8fd28cfd6a7094d67ae1.tar.gz ppe42-gcc-422eaae5fe0038ad189b8fd28cfd6a7094d67ae1.zip |
libgo: Update to weekly.2012-01-15.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183539 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/go/crypto/openpgp/errors/errors.go')
-rw-r--r-- | libgo/go/crypto/openpgp/errors/errors.go | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/libgo/go/crypto/openpgp/errors/errors.go b/libgo/go/crypto/openpgp/errors/errors.go new file mode 100644 index 00000000000..c434b764c9b --- /dev/null +++ b/libgo/go/crypto/openpgp/errors/errors.go @@ -0,0 +1,64 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package errors contains common error types for the OpenPGP packages. +package errors + +import ( + "strconv" +) + +// A StructuralError is returned when OpenPGP data is found to be syntactically +// invalid. +type StructuralError string + +func (s StructuralError) Error() string { + return "OpenPGP data invalid: " + string(s) +} + +// UnsupportedError indicates that, although the OpenPGP data is valid, it +// makes use of currently unimplemented features. +type UnsupportedError string + +func (s UnsupportedError) Error() string { + return "OpenPGP feature unsupported: " + string(s) +} + +// InvalidArgumentError indicates that the caller is in error and passed an +// incorrect value. +type InvalidArgumentError string + +func (i InvalidArgumentError) Error() string { + return "OpenPGP argument invalid: " + string(i) +} + +// SignatureError indicates that a syntactically valid signature failed to +// validate. +type SignatureError string + +func (b SignatureError) Error() string { + return "OpenPGP signature invalid: " + string(b) +} + +type keyIncorrectError int + +func (ki keyIncorrectError) Error() string { + return "the given key was incorrect" +} + +var KeyIncorrectError = keyIncorrectError(0) + +type unknownIssuerError int + +func (unknownIssuerError) Error() string { + return "signature make by unknown entity" +} + +var UnknownIssuerError = unknownIssuerError(0) + +type UnknownPacketTypeError uint8 + +func (upte UnknownPacketTypeError) Error() string { + return "unknown OpenPGP packet type: " + strconv.Itoa(int(upte)) +} |