camerrors: rename MissingKeyBlob to ErrMissingKeyBlob

Change-Id: I15b7e9c1d82b8933f7969d50030ae02fa27deae7
This commit is contained in:
Brad Fitzpatrick 2014-01-13 20:09:54 -08:00
parent 52ed51b80b
commit 3f68f21f56
2 changed files with 6 additions and 3 deletions

View File

@ -22,4 +22,7 @@ import (
"errors"
)
var MissingKeyBlob = errors.New("key blob not found")
// ErrMissingKeyBlob is returned by the jsonsign handler when a
// verification fails because the public key for a signed blob is
// missing.
var ErrMissingKeyBlob = errors.New("key blob not found")

View File

@ -138,11 +138,11 @@ func (vr *VerifyRequest) ParsePayloadMap() bool {
func (vr *VerifyRequest) FindAndParsePublicKeyBlob() bool {
reader, _, err := vr.fetcher.FetchStreaming(vr.CamliSigner)
if err != nil {
log.Printf("error fetching public key blob: %v", err)
log.Printf("error fetching public key blob %v: %v", vr.CamliSigner, err)
// TODO(mpl): we're losing some info here, so maybe
// create an error type that contains the reason,
// instead of logging the reason.
vr.Err = camerrors.MissingKeyBlob
vr.Err = camerrors.ErrMissingKeyBlob
return false
}
defer reader.Close()