From ef1d5caa1ae2bf49c787c13ce3e8e5e7a04ad0f0 Mon Sep 17 00:00:00 2001 From: Ying Li Date: Sun, 8 Nov 2015 16:09:52 -0800 Subject: [PATCH] Fix an error message when there are insufficient signatures. Signed-off-by: Ying Li Signed-off-by: David Lawrence Signed-off-by: Ying Li (github: endophage) --- tuf/signed/errors.go | 3 +-- tuf/signed/sign.go | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tuf/signed/errors.go b/tuf/signed/errors.go index c042e60685..6cddcf2ba4 100644 --- a/tuf/signed/errors.go +++ b/tuf/signed/errors.go @@ -8,11 +8,10 @@ import ( // metadata type ErrInsufficientSignatures struct { Name string - Err error } func (e ErrInsufficientSignatures) Error() string { - return fmt.Sprintf("tuf: insufficient signatures for %s: %s", e.Name, e.Err) + return fmt.Sprintf("tuf: insufficient signatures: %s", e.Name) } // ErrExpired indicates a piece of metadata has expired diff --git a/tuf/signed/sign.go b/tuf/signed/sign.go index 99987a2fb5..48a6efd7f0 100644 --- a/tuf/signed/sign.go +++ b/tuf/signed/sign.go @@ -68,8 +68,9 @@ func Sign(service CryptoService, s *data.Signed, keys ...data.PublicKey) error { } if len(signatures) < 1 { return ErrInsufficientSignatures{ - Name: fmt.Sprintf("Cryptoservice failed to produce any signatures for keys with IDs: %v", keyIDs), - Err: nil, + Name: fmt.Sprintf( + "Cryptoservice failed to produce any signatures for keys with IDs: %v", + keyIDs), } } for _, sig := range s.Signatures {