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
handlers: exit if a bad request or error is encountered #168
Conversation
Codecov Report
@@ Coverage Diff @@
## main #168 +/- ##
===================================================
- Coverage 44.75524% 44.65116% -0.10408%
===================================================
Files 24 24
Lines 1716 1720 +4
===================================================
Hits 768 768
- Misses 858 862 +4
Partials 90 90
Continue to review full report at Codecov.
|
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.
There is a missing one here
catalyst-api/handlers/upload.go
Line 147 in 10dd863
errors.WriteHTTPInternalServerError(w, "Cannot send transcode status", err) |
if err := clients.DefaultCallbackClient.SendTranscodeStatus(uploadVODRequest.CallbackUrl, clients.TranscodeStatusPreparing, 0.0); err != nil {
errors.WriteHTTPInternalServerError(w, "Cannot send transcode status", err)
}
@red-0ne I left that one out on purpose. That's the callback to studio so it didn't make sense to bail early if it happens to fail to notify studio - we should continue with everything anyways. |
LGTM, good job catching this @red-0ne! |
You are right. Thanks for the clarification. Shouldn't we have this in a goroutine to save up some transcoding time then? |
Also, we shouldn't write the error to the response then proceed to write response bytes coming out of transcoding. IMHO we should not do anything with responses from |
I think you're right on both counts @red-0ne - feel free to put in a followup PR to fix. I think the goroutine should be spawned intside the callback client and then it should just log and not return anything on errors |
I've worked on this followup. It seems that it is easier to have the goroutine outside of the callback if we want to keep testing against errors of the |
* improve error messages * update go-api-client to 0.2.4
No description provided.