-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conversation
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
+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") { |
There was a problem hiding this comment.
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") { |
There was a problem hiding this comment.
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") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
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"