From 66bc5ba5c1b67611815e70ad55ef42699768a12f Mon Sep 17 00:00:00 2001 From: emranemran Date: Tue, 19 Mar 2024 15:53:11 -0700 Subject: [PATCH] runner: add invalid segments to list of invalid errors --- task/runner.go | 3 +++ task/runner_test.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/task/runner.go b/task/runner.go index 7678f1d..cc0e9b5 100644 --- a/task/runner.go +++ b/task/runner.go @@ -651,6 +651,9 @@ func humanizeCatalystError(err error) error { if strings.Contains(errMsg, "error probing") { return errInvalidVideo } + if strings.Contains(errMsg, "no valid segments in stream to transcode") { + return errInvalidVideo + } // Livepeer pipeline errors if strings.Contains(errMsg, "unsupported input pixel format") { diff --git a/task/runner_test.go b/task/runner_test.go index a03fb59..8ae698b 100644 --- a/task/runner_test.go +++ b/task/runner_test.go @@ -88,6 +88,9 @@ func TestHumanizeError(t *testing.T) { err = NewCatalystError("external transcoder error: error creating mediaconvert job: InvalidParameter: 2 validation error(s) found.\n- minimum field value of 32, CreateJobInput.Settings.OutputGroups[0].Outputs[0].VideoDescription.Height.\n- minimum field value of 32, CreateJobInput.Settings.OutputGroups[0].Outputs[1].VideoDescription.Height.\n", false) assert.ErrorIs(humanizeError(err), errInvalidVideo) + err = NewCatalystError("transcoding failed: no valid segments in stream to transcode", false) + assert.ErrorIs(humanizeError(err), errInvalidVideo) + err = NewCatalystError("error copying input to storage: failed to copy file(s): error copying input file to S3: failed to write to OS URL \"s3+https://storage.googleapis.com/lp-us-catalyst-vod-com/hls/source/bdfgehfe/transfer\": MultipartUpload: upload multipart failed\n\tupload id: ABPnzm6RnhkmNJDt42Vk-cVm7lmNqrPVScIXmjIImSYzxlZ6L0MRhBSn0yfWu6_GNUko9e4\ncaused by: ReadRequestBody: read multipart upload data failed\ncaused by: unexpected EOF", false) assert.ErrorIs(humanizeError(err), errFileInaccessible)