This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Audio-ISSUE-22 (ExceptionType): Undefined exception type [Web Audio API] http://www.w3.org/2011/audio/track/issues/22 Raised by: Philip Jägenstedt On product: Web Audio API The phrase "An exception will be thrown" is used throughout the spec, but the specific exception that should be throw is never defined.
Comment from Chris Rogers, 18 May 2012 «I'm unfamiliar with common convention for "what type" of exceptions will be thrown. I'm happy to add them according to your exact recommendations»
The createBuffer method could be written as: If numberOfChannels is greater than 32, if sampleRate is less than 22050 or if sampleRate is greater than 96000, then throw an IndexSizeError. Otherwise, return a new AudioBuffer with sampleRate *sampleRate*, length *length*, numberOfChannels *numberOfChannels*, where all samples have the value 0. IndexSizeError works for most of these range-checks. For noteOn and other places that check state, InvalidStateError is appropriate. If exceptions are ever thrown in an algorithm with multiple steps, the magic words "and terminate these steps" must be included as noted in http://wiki.whatwg.org/wiki/Howto_spec#Dealing_with_exceptions
This issue has been stalled for a while - it was once assigned to Philip but he is set to be away for a while. Ehsan, is that something you could look into?
If that's OK with Chris, sure!
(In reply to comment #4) > If that's OK with Chris, sure! sounds good to me
*** Bug 19901 has been marked as a duplicate of this bug. ***
I've been pushing a patch [1] to address this problem, please complain if you think that we should throw different exceptions. [1] https://github.com/WebAudio/web-audio-api/commit/50ad9b6ec655d21ad80554e90263a008b08d4683
Web Audio API issues have been migrated to Github. See https://github.com/WebAudio/web-audio-api/issues
Closing. See https://github.com/WebAudio/web-audio-api/issues for up to date list of issues for the Web Audio API.