mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix(agent/agentscripts): display informative error for ErrWaitDelay (#10407)
Fixes #10400
This commit is contained in:
+2
-1
@@ -743,7 +743,7 @@ func (a *agent) run(ctx context.Context) error {
|
||||
return script.RunOnStart
|
||||
})
|
||||
if err != nil {
|
||||
a.logger.Warn(ctx, "startup script failed", slog.Error(err))
|
||||
a.logger.Warn(ctx, "startup script(s) failed", slog.Error(err))
|
||||
if errors.Is(err, agentscripts.ErrTimeout) {
|
||||
a.setLifecycle(ctx, codersdk.WorkspaceAgentLifecycleStartTimeout)
|
||||
} else {
|
||||
@@ -1465,6 +1465,7 @@ func (a *agent) Close() error {
|
||||
return script.RunOnStop
|
||||
})
|
||||
if err != nil {
|
||||
a.logger.Warn(ctx, "shutdown script(s) failed", slog.Error(err))
|
||||
if errors.Is(err, agentscripts.ErrTimeout) {
|
||||
lifecycleState = codersdk.WorkspaceAgentLifecycleShutdownTimeout
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user