-
Notifications
You must be signed in to change notification settings - Fork 35
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
util.js "reject is not defined" #4
Comments
Oh! Yes, this seems to be a legacy code error that has been corrected and will be fixed on 0.0.21. |
@Vinlic, thanks for the fix, and what about catching the error? |
Now you can listen for errors through the "error" event. :D |
@Vinlic , unfortunately i can't confirm. If you just replace reject() with "throw" it's not enough, because in Audio.js load() you return a promise. So you need to handle when it's rejected. |
@ivangusev ...
start() {
...
(async () => {
...
await this.#waitForAudiosLoaded(); // Waiting for all audio to load here.
...
})()
.catch(err => this._emitError(err)); // Will notify you of the error here
}
... |
@Vinlic , i think it's not the only place where it's called. I'm adding audio like this:
And error is not captured. Synthesizer.start() is not even reached to the time of error. |
@ivangusev |
@Vinlic , yes, that's what i meant: |
@ivangusev |
If we pass non-mp3 (jpeg for example) we get "ReferenceError: reject is not defined" in checkRemoteResource()
Also please handle the case of rejected promise in Audio.js load(), otherwise the whole application is crashed without catching the error.
Ideally i should get this error in:
The text was updated successfully, but these errors were encountered: