You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by lc...@apache.org on 2018/01/12 22:13:29 UTC

[beam] branch go-sdk updated: BEAM-3474 Include stacks in panic messages.

This is an automated email from the ASF dual-hosted git repository.

lcwik pushed a commit to branch go-sdk
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/go-sdk by this push:
     new 864b359  BEAM-3474 Include stacks in panic messages.
864b359 is described below

commit 864b359e12d0b4e77b2fc814413f189be86b170b
Author: Bill Neubauer <wc...@google.com>
AuthorDate: Fri Jan 12 11:12:29 2018 -0800

    BEAM-3474 Include stacks in panic messages.
---
 sdks/go/pkg/beam/core/runtime/exec/util.go | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sdks/go/pkg/beam/core/runtime/exec/util.go b/sdks/go/pkg/beam/core/runtime/exec/util.go
index d94649d..b3d8b29 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/util.go
+++ b/sdks/go/pkg/beam/core/runtime/exec/util.go
@@ -19,6 +19,7 @@ import (
 	"context"
 	"fmt"
 	"reflect"
+	"runtime/debug"
 )
 
 // GenID is a simple UnitID generator.
@@ -36,7 +37,7 @@ func (g *GenID) New() UnitID {
 func callNoPanic(ctx context.Context, fn func(context.Context) error) (err error) {
 	defer func() {
 		if r := recover(); r != nil {
-			err = fmt.Errorf("panic: %v", r)
+			err = fmt.Errorf("panic: %v %s", r, debug.Stack())
 		}
 	}()
 	return fn(ctx)
@@ -46,7 +47,7 @@ func callNoPanic(ctx context.Context, fn func(context.Context) error) (err error
 func reflectCallNoPanic(fn reflect.Value, args []reflect.Value) (ret []reflect.Value, err error) {
 	defer func() {
 		if r := recover(); r != nil {
-			err = fmt.Errorf("panic: %v", r)
+			err = fmt.Errorf("panic: %v %s", r, debug.Stack())
 		}
 	}()
 	return fn.Call(args), nil

-- 
To stop receiving notification emails like this one, please contact
['"commits@beam.apache.org" <co...@beam.apache.org>'].