Skip to content

Commit

Permalink
server: log stacks on 500 errors
Browse files Browse the repository at this point in the history
Before this change, we'd just log the error body, which often is not very
helpful. The format specifier makes me think that the intention was to log
the stacks. This made debugging [this](cockroachdb#83677 (comment))
trivial as opposed to hard.

Release note: None
  • Loading branch information
ajwerner committed Jul 7, 2022
1 parent 9c5472e commit 688f535
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/server/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func (s *adminServer) RegisterGateway(
// serverError logs the provided error and returns an error that should be returned by
// the RPC endpoint method.
func serverError(ctx context.Context, err error) error {
log.ErrorfDepth(ctx, 1, "%+s", err)
log.ErrorfDepth(ctx, 1, "%+v", err)
return errAdminAPIError
}

Expand Down

0 comments on commit 688f535

Please sign in to comment.