wavesurfer.js icon indicating copy to clipboard operation
wavesurfer.js copied to clipboard

Feat: add error event

Open zachkrall opened this issue 1 year ago • 1 comments

Short description

Adds support for wavesurfer.on('error') event. This is helpful when building components where the file source is unknown at build time and you might want to hook into that event to display an error message.

Implementation details

It catches errors thrown by "Fetcher.fetchBlob" and emits it as an event named error

How to test it

yarn test -- --spec ./cypress/e2e/error.cy.js

Screenshots

Checklist

  • [x] This PR is covered by e2e tests
  • [ ] It introduces no breaking API changes I think it's likely that this introduces a breaking API change if users previously relied on .create throwing an exception which is now caught and reported by .on('error').

zachkrall avatar Jan 29 '24 16:01 zachkrall

One of the tests seems to be failing on this branch.

katspaugh avatar Feb 05 '24 13:02 katspaugh