-
Notifications
You must be signed in to change notification settings - Fork 10
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
Can’t catch the 'All given promises failed' error. #86
Comments
Hey @chrism, looks like this is a legit bug with hifi that nobody has caught until now. I tried stepping through the code to see what was going on last night, but couldn't yet find what's throwing the error. |
@chrism This is still an issue in ember-hifi, but I will report that the fork of hifi I made called |
Oh wow @jkeen thanks for the heads up. In the end I'm using just howler and some custom code, but Ember Stereo looks like it could be a great upgrade. Going to take a proper look and give it a try. Thanks again! |
If anyone comes to this issue, I could solve it like this: I added a fallback for source: get sources() {
return [
{
url: myRealSrc,
mimeType: myRealMime,
},
{
url: '/assets/empty.mp3',
mimeType: 'audio/mpeg',
},
];
} Then in the load promise, I could throw and catch my own error: const { sound } = await this.hifi.load(this.sources);
if (sound.url === '/assets/empty.mp3') {
throw 'Given source should succeed';
} And on willDestroy() {
super.willDestroy(...arguments);
if (this.srcErr) {
this.hifi.soundCache.reset();
}
} I'm migrating to |
Hi, I’m using this approach to load my audio stream, which I took from this comment.
#36 (comment)
When one of the audio streams in the array works, this works great.
A problem arises though if none of the sources are working.
The
catch
does log the error message, but there’s still an additional uncaught promise error—which looks to be coming frompromise-race
.This output (with
debug: true
in the config)I’d really like to find a way to suppress this error but I’m a bit lost as I feel like it should have already been caught by the
load()
promise catch?Thanks for any help I’m struggling a bit with the docs on this.
The text was updated successfully, but these errors were encountered: