Skip to content

Formerly KrillinAI, VideoTranslation and Dubbing Tool for 120+ Languages. Open-source AI workspace for creators, powered by Codex. Video downloader, video translation, create videos, images, audios, and edits with Agents in one place. For your Social Media like YouTube, TikTok, Instagram, etc.

feat: handle failed task

沈浩dda4a0be21a6
diff --git a/internal/service/subtitle_service.go b/internal/service/subtitle_service.go
index b8f927df..d7d609dd 100644
--- a/internal/service/subtitle_service.go
+++ b/internal/service/subtitle_service.go
@@ -183,6 +183,9 @@ func (s Service) GetTaskStatus(req dto.GetVideoSubtitleTaskReq) (*dto.GetVideoSu
if task == nil {
return nil, errors.New("任务不存在")
}
+ if task.Status == types.SubtitleTaskStatusFailed {
+ return nil, fmt.Errorf("任务失败,原因:%s", task.FailReason)
+ }
return &dto.GetVideoSubtitleTaskResData{
TaskId: task.TaskId,
ProcessPercent: task.ProcessPct,