Skip to content

Commit 8a24dbb

Browse files
ashmckenzieIgor Drozdov
authored andcommitted
Include error and log as Error when recovering
1 parent 67f5742 commit 8a24dbb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

internal/sshd/connection.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func (c *connection) handleRequests(ctx context.Context, sconn *ssh.ServerConn,
132132
// Prevent a panic in a single session from taking out the whole server
133133
defer func() {
134134
if err := recover(); err != nil {
135-
ctxlog.WithField("recovered_error", err).Warn("panic handling session")
135+
ctxlog.WithField("recovered_error", err).Error("panic handling session")
136136
}
137137
}()
138138

internal/sshd/sshd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ func (s *Server) handleConn(ctx context.Context, nconn net.Conn) {
185185
// Prevent a panic in a single connection from taking out the whole server
186186
defer func() {
187187
if err := recover(); err != nil {
188-
ctxlog.Warn("panic handling session")
188+
ctxlog.WithField("recovered_error", err).Error("panic handling session")
189189

190190
metrics.SliSshdSessionsErrorsTotal.Inc()
191191
}

0 commit comments

Comments
 (0)