Add a strongly typed error for unrecognized kind/type/version

This commit is contained in:
Clayton Coleman
2014-12-03 08:40:30 -05:00
parent 3910b2d6e1
commit 84d84c50c2
4 changed files with 84 additions and 6 deletions

View File

@@ -115,7 +115,7 @@ func (s *Scheme) DecodeInto(data []byte, obj interface{}) error {
} else {
external, err := s.NewObject(dataVersion, dataKind)
if err != nil {
return fmt.Errorf("unable to create new object of type ('%s', '%s')", dataVersion, dataKind)
return err
}
// yaml is a superset of json, so we use it to decode here. That way,
// we understand both.