Hi @chemoish, currently We are using this package in our project and it is being really awesome so far. While debugging a concurrency restriction we have in the backend I was trying to add a custom error message in our player to handle that scenario and noticed that for some http responses that come from our backend the error is not being set in the player:
the only errors that error listen to are network errors and cross-origin errors, when I http response comes from the backend load handler will be called instead and the request is considered successful.
So, in order to catch all the errors that comes from the backend we have to check the satus code of the request and when is not 200 execute the error logic that will end up setting a custom error in the player instance.
Also I found a dependency error while trying to npm run build for babel-core so I added that package to devDependencies in a different commit. That change is totally unrelated to this PR so let me know if you want to remove that commit from this PR.
Summary
Hi @chemoish, currently We are using this package in our project and it is being really awesome so far. While debugging a concurrency restriction we have in the backend I was trying to add a custom error message in our player to handle that scenario and noticed that for some http responses that come from our backend the error is not being set in the player:
By looking at your code I think I found the problem so this PR is an attempt to fix it. When we
and then
the only errors that
error
listen to are network errors and cross-origin errors, when I http response comes from the backendload
handler will be called instead and the request is considered successful. So, in order to catch all the errors that comes from the backend we have to check the satus code of the request and when is not200
execute the error logic that will end up setting a custom error in the player instance.Also I found a dependency error while trying to
npm run build
forbabel-core
so I added that package todevDependencies
in a different commit. That change is totally unrelated to this PR so let me know if you want to remove that commit from this PR.Feedback is more than welcome!
Thank you.