Skip to content

Commit

Permalink
Humanize more input errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mjh1 authored and emranemran committed May 9, 2023
1 parent e2660f6 commit 321380d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions task/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions task/runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 321380d

Please sign in to comment.