beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lc...@apache.org
Subject [beam] branch go-sdk updated: BEAM-3474 Include stacks in panic messages.
Date Fri, 12 Jan 2018 22:13:29 GMT
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 <wcn@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" <commits@beam.apache.org>'].

Mime
View raw message