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


##########
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:
   Fixed. What about the suggestions on "wrap the type"? 
   Now the message is "try to wrap the type as a field in a struct, see 
https://github.com/apache/beam/issues/23101 for details", is it enough?
   I think giving a link to an issue but not a doc is not good. But for 
beginners, it's difficult to tell what to do just in the error message without 
a link because the error message is always simple and short. :)



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to