mirror of
				https://github.com/moby/moby.git
				synced 2022-11-09 12:21:53 -05:00 
			
		
		
		
	Show exact file being parsed on error.
When there's more than on json file in there we don't tell the user which one was an issue. Signed-off-by: Doug Davis <dug@us.ibm.com>
This commit is contained in:
		
							parent
							
								
									d951ef128f
								
							
						
					
					
						commit
						76106b494b
					
				
					 1 changed files with 3 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -3,6 +3,7 @@ package trust
 | 
			
		|||
import (
 | 
			
		||||
	"crypto/x509"
 | 
			
		||||
	"errors"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"io/ioutil"
 | 
			
		||||
	"net/http"
 | 
			
		||||
	"net/url"
 | 
			
		||||
| 
						 | 
				
			
			@ -81,12 +82,12 @@ func (t *TrustStore) reload() error {
 | 
			
		|||
	for i, match := range matches {
 | 
			
		||||
		f, err := os.Open(match)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return err
 | 
			
		||||
			return fmt.Errorf("Error opening %q: %s", match, err)
 | 
			
		||||
		}
 | 
			
		||||
		statements[i], err = trustgraph.LoadStatement(f, nil)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			f.Close()
 | 
			
		||||
			return err
 | 
			
		||||
			return fmt.Errorf("Error loading %q: %s", match, err)
 | 
			
		||||
		}
 | 
			
		||||
		f.Close()
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue