Skip to content

Commit

Permalink
Merge pull request #137 from openconfig/err-msg
Browse files Browse the repository at this point in the history
Improve error message
  • Loading branch information
wenovus authored Nov 11, 2023
2 parents af2a64f + 1850293 commit 1c8deb5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pathgen/pathgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ func getNodeDataMap(ir *ygen.IR, fakeRootName, schemaStructPkgAccessor, pathStru
relPath := longestPath(field.MappedPaths)
relMods := longestPath(field.MappedPathModules)
if gotLen := len(relPath); gotLen != 2 {
errs = util.AppendErr(errs, fmt.Errorf("expected two path elements for the relative path of an ordered map, got %d: %v", gotLen, relPath))
errs = util.AppendErr(errs, fmt.Errorf("expected two path elements for the relative path of an atomic list or ordered list, got %d: %v", gotLen, relPath))
continue
}
nodeData.CompressInfo = &CompressionInfo{
Expand Down Expand Up @@ -1340,7 +1340,7 @@ func generateChildConstructors(methodBuf *strings.Builder, builderBuf *strings.B
return nil
}
if gotLen := len(path); compressBehaviour.CompressEnabled() && gotLen != 2 {
return []error{fmt.Errorf("expected two path elements for the relative path of an ordered map, got %d: %v", gotLen, path)}
return []error{fmt.Errorf("expected two path elements for the relative path of an atomic list or ordered list, got %d: %v", gotLen, path)}
}
fieldData.RelPathList = relPathListFn(path[:1])
fieldData.TypeName += WholeKeyedListSuffix
Expand Down

0 comments on commit 1c8deb5

Please sign in to comment.