Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Humanize some Catalyst errors #101

Merged
merged 3 commits into from
Dec 13, 2022
Merged

Humanize some Catalyst errors #101

merged 3 commits into from
Dec 13, 2022

Conversation

yondonfu
Copy link
Member

@yondonfu yondonfu commented Dec 13, 2022

Adds humanized versions of a few additional Catalyst errors:

Internal error type: 504 gateway timeouts during file import
Humanized error: file could not be imported from URL because it was not accessible

Internal error type: Unsupported video files for MediaConvert
Humanized error: invalid video file codec or container, check your input file against the input codec and container support matrix

Internal error type: Failure to probe or open files for MediaConvert
Humanized error: failed to probe or open file, check your input file against the input codec and container support matrix

These humanized errors should help with error filtering and categorization at the Studio API task level since these humanized errors can be stored as the error message for a failed task instead of the generic "internal error processing file"

@codecov
Copy link

codecov bot commented Dec 13, 2022

Codecov Report

Merging #101 (d6a5c13) into main (66ef87d) will decrease coverage by 0.04580%.
The diff coverage is 0.00000%.

Impacted file tree graph

@@                Coverage Diff                @@
##               main       #101         +/-   ##
=================================================
- Coverage   5.45262%   5.40682%   -0.04580%     
=================================================
  Files            14         14                 
  Lines          1889       1905         +16     
=================================================
  Hits            103        103                 
- Misses         1777       1793         +16     
  Partials          9          9                 
Impacted Files Coverage Δ
task/runner.go 5.12821% <0.00000%> (-0.21938%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 66ef87d...d6a5c13. Read the comment docs.

Impacted Files Coverage Δ
task/runner.go 5.12821% <0.00000%> (-0.21938%) ⬇️

@yondonfu yondonfu marked this pull request as ready for review December 13, 2022 21:44
@yondonfu yondonfu requested a review from a team as a code owner December 13, 2022 21:44
@pglowacky
Copy link

+1 to humanized error messages

if strings.Contains(errMsg, "doesn't have video that the transcoder can consume") {
// TODO(yondonfu): Add link in this error message to a page with the input codec/container support matrix
return errors.New("invalid video file codec or container, check your input file against the input codec and container support matrix")
} else if strings.Contains(errMsg, "Failed probe/open") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notice that the error message is lowercased, so it will never match this. Needs to match against an all lowercase string instead.

Edit: realized that this came as a debt from the previous code that did these checks. I guess that has never worked 😯

// Livepeer pipeline errors
if strings.Contains(errMsg, "unsupported input pixel format") {
return errors.New("unsupported input pixel format, must be 'yuv420p' or 'yuvj420p'")
} else if strings.Contains(errMsg, "Unsupported video input") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for casing

return errors.New("unsupported input pixel format, must be 'yuv420p' or 'yuvj420p'")
} else if strings.Contains(errMsg, "Unsupported video input") {
return errors.New("unsupported file format")
} else if strings.Contains(errMsg, "ReadPacketData File read failed - end of file hit") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants