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

Add new error code for segment fetch errors. #2118

Open
OrenMe opened this issue Aug 25, 2019 · 3 comments
Open

Add new error code for segment fetch errors. #2118

OrenMe opened this issue Aug 25, 2019 · 3 comments
Labels
flag: good first issue This might be a relatively easy issue; good for new contributors priority: P3 Useful but not urgent type: enhancement New feature or request
Milestone

Comments

@OrenMe
Copy link
Contributor

OrenMe commented Aug 25, 2019

While investigating the request/response filters mechanism I saw you have different error propagation between license and other request/response types.
For license, no matter what error the underlying networking engine throws, the DRM engine will turn it to a LICENSE_REQUEST_FAILED error.
https://github.com/google/shaka-player/blob/e7a5bb9ecf07c5a0ac0d87d2a7a44e24d6a371f0/lib/media/drm_engine.js#L1122-L1140
For other types of requests the streaming engine will re-throw the networking engine error(last else clause, lines 1607-1614):
https://github.com/google/shaka-player/blob/e7a5bb9ecf07c5a0ac0d87d2a7a44e24d6a371f0/lib/media/streaming_engine.js#L1579-L1615
So if there was a filter request or response error the application using the player can know if it is a filter error or an actual HTTP error.
(the streaming engine actually does have also different handling for all of if-else clauses - so maybe this is also valid for them - you will not know that they failed due to filter error, like the license).

Is there a reason for this inconsistency in behaviour? does it serve a purpose?

@OrenMe OrenMe added the type: question A question from the community label Aug 25, 2019
@joeyparrish
Copy link
Member

Is there a reason for this inconsistency in behaviour? does it serve a purpose?

Yes, but we're always open to feedback.

If we throw a generic networking error, you might not easily know it was a license request failure. You might want to handle a license request failure differently from some other networking failure. And if you want the original networking error, you can access it from error.data[0] as documented here: https://shaka-player-demo.appspot.com/docs/api/shaka.util.Error.html#value:6007

error.data[0] is a shaka.util.Error from the networking engine.

Does this make sense?

@OrenMe
Copy link
Contributor Author

OrenMe commented Aug 27, 2019

@joeyparrish this makes sense, but in this case shouldn’t the other way be aligned?
I mean, the streaming engine does emit the underlying network error as is in this case.
Should this be amended? And in this case is the request/response filter error should always be in the payload of their respective higher level engine/controller?
I’m wrapping shaka’s API with an abstraction later and also wondering if I should use the request/response filter error or report it as license/manifest/segment loading error.

@TheModMaker
Copy link
Contributor

I guess that makes sense. We can add a new error code for SEGMENT_FETCH_ERROR to differentiate the source of the network error. This would be a breaking change since apps would no longer see errors like HTTP_ERROR anymore. We should also update the display in the demo app to handle these nested errors better.

@TheModMaker TheModMaker added type: enhancement New feature or request and removed type: question A question from the community labels Sep 4, 2019
@TheModMaker TheModMaker added this to the Backlog milestone Sep 4, 2019
@joeyparrish joeyparrish modified the milestones: Backlog, Backlog 2 Jan 28, 2020
@theodab theodab changed the title request/response filter errors Sep 23, 2021
@theodab theodab added flag: good first issue This might be a relatively easy issue; good for new contributors priority: P3 Useful but not urgent labels Oct 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flag: good first issue This might be a relatively easy issue; good for new contributors priority: P3 Useful but not urgent type: enhancement New feature or request
4 participants