Skip to content

Commit

Permalink
Log remote call stacktrace in debug mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
cscatolini committed May 17, 2018
1 parent a121427 commit 507c0c7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"errors"
"os"
"reflect"
"runtime/debug"

"github.com/topfreegames/pitaya/constants"
e "github.com/topfreegames/pitaya/errors"
Expand All @@ -40,6 +41,7 @@ func Pcall(method reflect.Method, args []reflect.Value) (rets interface{}, err e
defer func() {
if rec := recover(); rec != nil {
logger.Log.Errorf("pitaya/dispatch: %v", rec)
logger.Log.Debugf("%s", debug.Stack())
if s, ok := rec.(string); ok {
err = errors.New(s)
} else {
Expand Down

0 comments on commit 507c0c7

Please sign in to comment.