You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2023/01/05 19:09:49 UTC

[GitHub] [beam] lostluck commented on a diff in pull request #24844: Improve error message for unencodeable types

lostluck commented on code in PR #24844:
URL: https://github.com/apache/beam/pull/24844#discussion_r1062804891


##########
sdks/go/pkg/beam/core/runtime/graphx/coder.go:
##########
@@ -446,10 +446,9 @@ func (b *CoderMarshaller) Add(c *coder.Coder) (string, error) {
 	case coder.Custom:
 		ref, err := encodeCustomCoder(c.Custom)
 		if err != nil {
-			typeName := c.Custom.Name
-			return "", errors.SetTopLevelMsgf(err, "failed to encode custom coder for type %s. "+
+			return "", errors.SetTopLevelMsgf(err, "failed to encode custom coder %s for TypeName %s. "+
 				"Make sure the type was registered before calling beam.Init. For example: "+
-				"beam.RegisterType(reflect.TypeOf((*TypeName)(nil)).Elem())", typeName)
+				"beam.RegisterType(reflect.TypeOf((*TypeName)(nil)).Elem()). Some types can't be registered, see invalid registration types as below:(Link)", c, c.Custom.Type)

Review Comment:
   "Some types, like maps, slices, arrays, channels, and functions cannot be registered as types."



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org