Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b4ba237

Browse files
committed
Rename CoderSessionExitCode to MagicSessionExitCode
Signed-off-by: Spike Curtis <[email protected]>
1 parent fc4e97d commit b4ba237

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

agent/agent.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ const (
4444
ProtocolSSH = "ssh"
4545
ProtocolDial = "dial"
4646

47-
// CoderSessionErrorCode indicates that something went wrong with the session, rather than the
47+
// MagicSessionErrorCode indicates that something went wrong with the session, rather than the
4848
// command just returning a nonzero exit code, and is chosen as an arbitrary, high number
4949
// unlikely to shadow other exit codes, which are typically 1, 2, 3, etc.
50-
CoderSessionErrorCode = 229
50+
MagicSessionErrorCode = 229
5151
)
5252

5353
type Options struct {
@@ -286,7 +286,9 @@ func (a *agent) init(ctx context.Context) {
286286
}
287287
if err != nil {
288288
a.logger.Warn(ctx, "ssh session failed", slog.Error(err))
289-
_ = session.Exit(CoderSessionErrorCode)
289+
// This exit code is designed to be unlikely to be confused for a legit exit code
290+
// from the process.
291+
_ = session.Exit(MagicSessionErrorCode)
290292
return
291293
}
292294
},

0 commit comments

Comments
 (0)