[
https://issues.apache.org/jira/browse/BEAM-6838?focusedWorklogId=216543&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-216543
]
ASF GitHub Bot logged work on BEAM-6838:
----------------------------------------
Author: ASF GitHub Bot
Created on: 20/Mar/19 23:53
Start Date: 20/Mar/19 23:53
Worklog Time Spent: 10m
Work Description: youngoli commented on pull request #8064: [BEAM-6838]
Go SDK: Improving error msgs in pipeline serialization.
URL: https://github.com/apache/beam/pull/8064#discussion_r267590502
##########
File path: sdks/go/pkg/beam/core/runtime/graphx/serialize.go
##########
@@ -207,45 +207,45 @@ func encodeFn(u *graph.Fn) (*v1.Fn, error) {
case u.Fn != nil:
fn, err := encodeUserFn(u.Fn)
if err != nil {
- return nil, fmt.Errorf("bad userfn: %v", err)
+ return nil, fmt.Errorf("failed to encode function %v,
bad userfn: %v", u, err)
}
return &v1.Fn{Fn: fn}, nil
case u.Recv != nil:
t := reflect.TypeOf(u.Recv)
k, ok := runtime.TypeKey(reflectx.SkipPtr(t))
if !ok {
- return nil, fmt.Errorf("bad recv: %v", u.Recv)
+ return nil, fmt.Errorf("failed to encode function %v,
bad receiver %v", u, u.Recv)
}
if _, ok := runtime.LookupType(k); !ok {
- return nil, fmt.Errorf("recv type must be registered:
%v", t)
+ return nil, fmt.Errorf("failed to encode function %v,
receiver type %v must be registered", u, t)
}
typ, err := encodeType(t)
if err != nil {
- panic(fmt.Sprintf("bad recv type: %v", u.Recv))
+ panic(fmt.Sprintf("Failed to encode function %v, bad
receiver type: %v", u, err))
}
data, err := json.Marshal(u.Recv)
if err != nil {
- return nil, fmt.Errorf("bad userfn: %v", err)
+ return nil, fmt.Errorf("failed to encode function %v,
bad userfn: %v", u, err)
}
return &v1.Fn{Type: typ, Opt: string(data)}, nil
default:
- panic("empty Fn")
+ panic(fmt.Sprintf("Failed to encode function %v, empty fn", u))
}
}
func decodeFn(u *v1.Fn) (*graph.Fn, error) {
if u.Dynfn != nil {
gen, err := runtime.ResolveFunction(u.Dynfn.Gen, genFnType)
if err != nil {
- return nil, fmt.Errorf("bad symbol %v: %v",
u.Dynfn.Gen, err)
+ return nil, fmt.Errorf("failed to decode function proto
%v, bad symbol %v: %v", u, u.Dynfn.Gen, err)
}
t, err := decodeType(u.Dynfn.Type)
if err != nil {
- return nil, fmt.Errorf("bad type: %v", err)
+ return nil, fmt.Errorf("failed to decode function proto
%v, bad type: %v", u, err)
Review comment:
Done.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 216543)
Time Spent: 5h 50m (was: 5h 40m)
> Improve error messages for unregistered protos
> ----------------------------------------------
>
> Key: BEAM-6838
> URL: https://issues.apache.org/jira/browse/BEAM-6838
> Project: Beam
> Issue Type: Sub-task
> Components: sdk-go
> Reporter: Daniel Oliveira
> Assignee: Daniel Oliveira
> Priority: Minor
> Time Spent: 5h 50m
> Remaining Estimate: 0h
>
> When users have a type that can't be serialized (it has a function Field or
> similar) or more complex protocol buffers, the error should be improved to
> display the type being registered, and better yet, the beam.RegisterType(...)
> code they can use to enable use of their type.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)