[
https://issues.apache.org/jira/browse/BEAM-3878?focusedWorklogId=131945&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-131945
]
ASF GitHub Bot logged work on BEAM-3878:
----------------------------------------
Author: ASF GitHub Bot
Created on: 07/Aug/18 17:01
Start Date: 07/Aug/18 17:01
Worklog Time Spent: 10m
Work Description: herohde commented on a change in pull request #6156:
[BEAM-3878] Improve error reporting in calls.go
URL: https://github.com/apache/beam/pull/6156#discussion_r208309413
##########
File path: sdks/go/pkg/beam/core/util/reflectx/calls.tmpl
##########
@@ -57,7 +60,9 @@ func (c *shimFunc{{$in}}x{{$out}})
Call{{$in}}x{{$out}}({{mkargs $in "arg%v" "in
func ToFunc{{$in}}x{{$out}}(c Func) Func{{$in}}x{{$out}} {
if c.Type().NumIn() != {{$in}} || c.Type().NumOut() != {{$out}} {
- panic("incompatible func type")
+ panic(fmt.Sprintf("incompatible func type, expected function of
{{$in}} " +
+ "inputs & {{$out}} outputs and instead received a function of %d inputs
and %d" +
Review comment:
Good change.
Small suggestion: maybe include the full function type as well? Btw, the
usual way of writing these error messages in the opinionated language of Go is
a terse got-then-want style: "blah: %v, want %v".
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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: 131945)
Time Spent: 0.5h (was: 20m)
> Improve error reporting in calls.go
> -----------------------------------
>
> Key: BEAM-3878
> URL: https://issues.apache.org/jira/browse/BEAM-3878
> Project: Beam
> Issue Type: Improvement
> Components: sdk-go
> Reporter: Bill Neubauer
> Priority: Minor
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> The error messages generated in calls.go are not as helpful as they could be.
> Instead of simply reporting "incompatible func type" it would be great if
> they reported the topology of the actual function supplied versus what is
> expected. That would make debugging a lot easier.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)