Include FFmpeg stderr in snippet job errors
This commit is contained in:
parent
038c1567eb
commit
3a60494fca
7
main.go
7
main.go
|
|
@ -2182,12 +2182,13 @@ func (s *appState) executeSnippetJob(ctx context.Context, job *queue.Job, progre
|
||||||
cmd := exec.CommandContext(ctx, platformConfig.FFmpegPath, args...)
|
cmd := exec.CommandContext(ctx, platformConfig.FFmpegPath, args...)
|
||||||
utils.ApplyNoWindow(cmd)
|
utils.ApplyNoWindow(cmd)
|
||||||
|
|
||||||
if err := cmd.Run(); err != nil {
|
out, err := cmd.CombinedOutput()
|
||||||
|
if err != nil {
|
||||||
if logFile != nil {
|
if logFile != nil {
|
||||||
fmt.Fprintf(logFile, "\nStatus: failed at %s\nError: %v\n", time.Now().Format(time.RFC3339), err)
|
fmt.Fprintf(logFile, "\nStatus: failed at %s\nError: %v\nFFmpeg output:\n%s\n", time.Now().Format(time.RFC3339), err, string(out))
|
||||||
_ = logFile.Close()
|
_ = logFile.Close()
|
||||||
}
|
}
|
||||||
return err
|
return fmt.Errorf("snippet failed: %w\nffmpeg output:\n%s", err, string(out))
|
||||||
}
|
}
|
||||||
if logFile != nil {
|
if logFile != nil {
|
||||||
fmt.Fprintf(logFile, "\nStatus: completed at %s\n", time.Now().Format(time.RFC3339))
|
fmt.Fprintf(logFile, "\nStatus: completed at %s\n", time.Now().Format(time.RFC3339))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user