File tree Expand file tree Collapse file tree
packages/commands/src/commands/video Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,10 +53,15 @@ export default defineCommand({
5353 } ) ;
5454
5555 if ( taskInfo . output . task_status !== "SUCCEEDED" ) {
56+ const status = taskInfo . output . task_status ;
57+ const detail = taskInfo . output . message || taskInfo . output . code ;
58+ const message = detail
59+ ? `Task is not complete (status: ${ status } ): ${ detail } `
60+ : `Task is not complete (status: ${ status } ).` ;
5661 throw new BailianError (
57- `Task is not complete (status: ${ taskInfo . output . task_status } ).` ,
62+ message ,
5863 ExitCode . GENERAL ,
59- "Wait for the task to complete before downloading." ,
64+ status === "FAILED" ? undefined : "Wait for the task to complete before downloading." ,
6065 ) ;
6166 }
6267
Original file line number Diff line number Diff line change 22 defineCommand ,
33 taskPath ,
44 detectOutputFormat ,
5+ stripUndefined ,
56 type DashScopeTaskResponse ,
67} from "bailian-cli-core" ;
78import { emitResult , emitBare } from "bailian-cli-runtime" ;
@@ -42,15 +43,20 @@ export default defineCommand({
4243 return ;
4344 }
4445
46+ // 透传服务端失败字段:FAILED 时 output.code / output.message 是排查依据;request_id 便于工单溯源。
4547 emitResult (
46- {
48+ stripUndefined ( {
4749 task_id : response . output . task_id ,
4850 task_status : response . output . task_status ,
4951 video_url : response . output . video_url ,
5052 results : response . output . results ,
5153 submit_time : response . output . submit_time ,
54+ scheduled_time : response . output . scheduled_time ,
5255 end_time : response . output . end_time ,
53- } ,
56+ code : response . output . code ,
57+ message : response . output . message ,
58+ request_id : response . request_id ,
59+ } ) ,
5460 format ,
5561 ) ;
5662 } ,
You can’t perform that action at this time.
0 commit comments