You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Prompt cancellation exits 201 instead of documented 205 #3040
Continue? [y/N]: ntask: Failed to run task "prompted": task: Task "prompted" cancelled by userexit= 201
Actual result: exit 201 Expected result: exit 205
I have tested this on v3.48.0 and v3.53.1.
I looked into the code and found what I believe to be the defect.
TaskCancelledByUserError.Code() = CodeTaskCancelled (205), but task.go
(RunTask, identical in v3.48.0 and v3.53.0) wraps every body error in TaskRunError{...} whose Code() = 201, and cmd/task/task.go resolves the exit code with a non-unwrapping type
assertion err.(errors.TaskError) — the inner 205 is shadowed on both versions.
Activity
fix: report the specific exit code when a task's body error is a Task…