mirror of https://github.com/docker/docs.git
				
				
				
			Fix an error message when there are insufficient signatures.
Signed-off-by: Ying Li <ying.li@docker.com> Signed-off-by: David Lawrence <david.lawrence@docker.com> Signed-off-by: Ying Li <ying.li@docker.com> (github: endophage)
This commit is contained in:
		
							parent
							
								
									3398994ae0
								
							
						
					
					
						commit
						ef1d5caa1a
					
				|  | @ -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
 | ||||
|  |  | |||
|  | @ -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 { | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue