From 321380d0e37a4aecc21bfd464d8f8bd16469ed8f Mon Sep 17 00:00:00 2001 From: Max Holland Date: Tue, 9 May 2023 16:09:32 +0100 Subject: [PATCH] Humanize more input errors --- task/runner.go | 4 ++++ task/runner_test.go | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/task/runner.go b/task/runner.go index d156d9b5..0195ae49 100644 --- a/task/runner.go +++ b/task/runner.go @@ -596,6 +596,10 @@ func humanizeCatalystError(err error) error { "maximum resolution is", "unsupported video input", "scaler position rectangle is outside output frame", + "received non-media manifest", + "no audio frames decoded on", + "there is no frame rate information in the input stream info", + "minimum field value of", } // MediaConvert pipeline errors diff --git a/task/runner_test.go b/task/runner_test.go index 5b489e93..2dff4e06 100644 --- a/task/runner_test.go +++ b/task/runner_test.go @@ -75,6 +75,18 @@ func TestHumanizeError(t *testing.T) { err = NewCatalystError("external transcoder error: job failed: IP Stage runtime error on gpu [0] pipeline. [Scaler position rectangle is outside output frame ]", false) assert.ErrorIs(humanizeError(err), errInvalidVideo) + + err = NewCatalystError("error copying input to storage: failed to copy file(s): error downloading HLS input manifest: received non-Media manifest, but currently only Media playlists are supported", false) + assert.ErrorIs(humanizeError(err), errInvalidVideo) + + err = NewCatalystError("external transcoder error: job failed: No audio frames decoded on [selector-(Audio Selector 1)-track-1-drc]", false) + assert.ErrorIs(humanizeError(err), errInvalidVideo) + + err = NewCatalystError("external transcoder error: job failed: Frame rate is set to follow, but there is no frame rate information in the input stream info", false) + assert.ErrorIs(humanizeError(err), errInvalidVideo) + + 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) } func TestSimplePublishErrorDoesNotPanic(t *testing.T) {