Closed ameliemaia closed 7 years ago
Hi Ian,
Whilst writing a test for loading I came across a bug where onError never gets fired if the asset url is wrong.
const sound = sono.load({ src: [ '/assets/audio/dnb-loop.m3', ], onComplete: () => { console.log('loaded'); }, onError: () => { console.log('error'); } });
However if I then add this after the code above both error events get fired:
sound.on('error', () => { console.log('error2'); })
I looked at https://github.com/Stinkstudios/sono/blob/master/test/loader.spec.js and noticed you didn't have a test for assets failing to load.
https://github.com/Stinkstudios/sono/blob/master/test/loader.spec.js
Let me know if you need anymore info!
Hi Amelie. Thanks for finding this. Error handling isn't the best at the moment in sono -- I think, as you mention, the first step is getting some unit tests in to see where it needs some love
Hi Ian,
Whilst writing a test for loading I came across a bug where onError never gets fired if the asset url is wrong.
However if I then add this after the code above both error events get fired:
I looked at
https://github.com/Stinkstudios/sono/blob/master/test/loader.spec.js
and noticed you didn't have a test for assets failing to load.Let me know if you need anymore info!