beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Work logged] (BEAM-3878) Improve error reporting in calls.go
Date Tue, 18 Sep 2018 22:27:00 GMT


ASF GitHub Bot logged work on BEAM-3878:

                Author: ASF GitHub Bot
            Created on: 18/Sep/18 22:26
            Start Date: 18/Sep/18 22:26
    Worklog Time Spent: 10m 
      Work Description: lostluck commented on a change in pull request #6156: [BEAM-3878]
Improve error reporting in calls.go

 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"
 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:
   +1 to this being a good change, and I like henning's suggestion.
   I agree that we should also include the type signature of the failing function since it'll
help narrow down where something went wrong if the stack trace gets swallowed.
   %v and passing in c.Type() will accomplish that.
   panic(fmt.Sprintf("incompatible func type: %v has %d %d inputs and %d outputs, " +    "
want function of {{$in}} inputs & {{$out}} outputs", c.Type(), c.Type().NumIn(), c.Type().NumOut()))

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:

Issue Time Tracking

    Worklog Id:     (was: 145509)
    Time Spent: 1h  (was: 50m)

> Improve error reporting in calls.go
> -----------------------------------
>                 Key: BEAM-3878
>                 URL:
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-go
>            Reporter: Bill Neubauer
>            Priority: Minor
>          Time Spent: 1h
>  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

View raw message