[
https://issues.apache.org/jira/browse/BEAM-6838?focusedWorklogId=215036&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-215036
]
ASF GitHub Bot logged work on BEAM-6838:
----------------------------------------
Author: ASF GitHub Bot
Created on: 18/Mar/19 21:32
Start Date: 18/Mar/19 21:32
Worklog Time Spent: 10m
Work Description: lostluck commented on pull request #8064: [BEAM-6838]
Go SDK: Improving error msgs in pipeline serialization.
URL: https://github.com/apache/beam/pull/8064#discussion_r266630172
##########
File path: sdks/go/pkg/beam/core/runtime/graphx/coder.go
##########
@@ -157,7 +157,7 @@ func (b *CoderUnmarshaller) makeCoder(c *pb.Coder)
(*coder.Coder, error) {
case urnKVCoder:
if len(components) != 2 {
- return nil, fmt.Errorf("bad pair: %v", c)
+ return nil, fmt.Errorf("could not make coder from proto
%v, incorrect number of components for pair", *c)
Review comment:
("could not unmarshal KV coder from %v, want exactly 2 components, but have
%d", *c, len(components))
The two notes here:
1. Don't mention proto in the error message, it's an implementation detail
for how the coder is serialized, that is not a detail helpful to the user, nor
the SDK developer.
2. Do mention the context for what it was trying to do, in this case make a
KV coder. It's ok to be explicit and precise that it needs something exactly
(eg. 2 components), vs at least, or at most 2 components.
3. Do make it easy to find where the message is generated (eg. uniqueness,
and clarity of which parts are input dependant). This will be mitigated in
later Go releases, but it's a nice formalism. The improved context helps this
significantly. (eg. unmarshal KV coder) is unique and will point to this line
in particular.
----------------------------------------------------------------
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: 215036)
Time Spent: 50m (was: 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: 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)