{"record":{"id":"2473c8f07c575a40","repo":"GopeedLab/gopeed","slug":"timeout-waiting-for-task-s","errorCode":null,"errorMessage":"timeout waiting for task %s","messagePattern":"timeout waiting for task (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/extmock/main.go","lineNumber":617,"sourceCode":"\tdownloader *download.Downloader\n}\n\nfunc newTaskTerminalWaiter(d *download.Downloader) *taskTerminalWaiter {\n\treturn &taskTerminalWaiter{downloader: d}\n}\n\nfunc (w *taskTerminalWaiter) Register(id string) {\n}\n\nfunc (w *taskTerminalWaiter) Wait(id string, timeout time.Duration) (*download.Task, error) {\n\tdeadline := time.Now().Add(timeout)\n\tfor time.Now().Before(deadline) {\n\t\tif task, ok := w.currentTerminalTask(id); ok {\n\t\t\treturn task, w.taskError(task)\n\t\t}\n\t\ttime.Sleep(50 * time.Millisecond)\n\t}\n\treturn nil, fmt.Errorf(\"timeout waiting for task %s\", id)\n}\n\nfunc (w *taskTerminalWaiter) currentTerminalTask(id string) (*download.Task, bool) {\n\ttask := w.downloader.GetTask(id)\n\tif task == nil {\n\t\treturn nil, false\n\t}\n\tif task.Status != base.DownloadStatusDone && task.Status != base.DownloadStatusError {\n\t\treturn nil, false\n\t}\n\treturn task, true\n}\n\nfunc (w *taskTerminalWaiter) taskError(task *download.Task) error {\n\tif task == nil {\n\t\treturn fmt.Errorf(\"task is nil\")\n\t}\n\tif task.Status == base.DownloadStatusError {","sourceCodeStart":599,"sourceCodeEnd":635,"githubUrl":"https://github.com/GopeedLab/gopeed/blob/7b7327ffb30816273a74b142cccc0bc10c5a4c67/cmd/extmock/main.go#L599-L635","documentation":"Error \"timeout waiting for task %s\" thrown in GopeedLab/gopeed.","triggerScenarios":"Thrown at cmd/extmock/main.go:617 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b7327ffb30816273a74b142cccc0bc10c5a4c67","analyzedAt":"2026-08-16T02:51:03.250Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}