Skip to content

Commit

Permalink
Fixed error handling + improved logging of a stack trace
Browse files Browse the repository at this point in the history
  • Loading branch information
glpatcern committed Aug 3, 2020
1 parent 020ae69 commit 612baf8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions internal/grpc/interceptors/recovery/recovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ func NewStream() grpc.StreamServerInterceptor {
}

func recoveryFunc(ctx context.Context, p interface{}) (err error) {
stack := debug.Stack()
debug.PrintStack()
log := appctx.GetLogger(ctx)
log.Error().Str("stack", string(stack)).Msgf("%+v", p)
log.Error().Msgf("%+v", p)
return status.Errorf(codes.Internal, "%s", p)
}
2 changes: 1 addition & 1 deletion internal/grpc/services/appprovider/appprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func (s *service) OpenFileInAppProvider(ctx context.Context, req *providerpb.Ope

if openRes.StatusCode != http.StatusOK {
res := &providerpb.OpenFileInAppProviderResponse{
Status: status.NewInternal(ctx, err, "appprovider: error performing open request to WOPI, status code: "+strconv.Itoa(openRes.StatusCode)),
Status: status.NewInvalid(ctx, "appprovider: error performing open request to WOPI, status code: "+strconv.Itoa(openRes.StatusCode)),
}
return res, nil
}
Expand Down

0 comments on commit 612baf8

Please sign in to comment.