add source filename in error message

This commit is contained in:
feihujiang 2015-03-27 09:28:48 +08:00
parent 13ae40681a
commit 6b79dcaa4d

View File

@ -39,7 +39,7 @@ type Mapper struct {
func (m *Mapper) InfoForData(data []byte, source string) (*Info, error) {
json, err := yaml.ToJSON(data)
if err != nil {
return nil, fmt.Errorf("unable to parse %q: %v", err)
return nil, fmt.Errorf("unable to parse %q: %v", source, err)
}
data = json
version, kind, err := m.DataVersionAndKind(data)