Bug 17325 - (ExceptionType): Undefined exception type
Summary: (ExceptionType): Undefined exception type
Alias: None
Product: AudioWG - OBSOLETE - Moved to Github
Classification: Unclassified
Component: Web Audio API - OBSOLETE - See Github (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: TBD
Assignee: Philip Jägenstedt
QA Contact: This bug has no owner yet - up for the taking
Depends on:
Reported: 2012-06-05 11:17 UTC by Philip Jägenstedt
Modified: 2014-10-28 17:16 UTC (History)
5 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Philip Jägenstedt 2012-06-05 11:17:32 UTC
Audio-ISSUE-22 (ExceptionType): Undefined exception type [Web Audio API]


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 1 Olivier Thereaux 2012-06-07 15:51:18 UTC
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»
Comment 2 Philip Jägenstedt 2012-07-26 12:40:09 UTC
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
Comment 3 Olivier Thereaux 2013-02-08 13:51:21 UTC
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?
Comment 4 Ehsan Akhgari [:ehsan] 2013-02-17 22:38:29 UTC
If that's OK with Chris, sure!
Comment 5 Chris Rogers 2013-02-18 00:40:26 UTC
(In reply to comment #4)
> If that's OK with Chris, sure!

sounds good to me
Comment 6 paul@paul.cx 2013-09-06 14:45:42 UTC
*** Bug 19901 has been marked as a duplicate of this bug. ***
Comment 7 paul@paul.cx 2013-09-09 13:09:57 UTC
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
Comment 8 Olivier Thereaux 2014-10-28 17:14:04 UTC
Web Audio API issues have been migrated to Github. 
See https://github.com/WebAudio/web-audio-api/issues
Comment 9 Olivier Thereaux 2014-10-28 17:16:56 UTC
Closing. See https://github.com/WebAudio/web-audio-api/issues for up to date list of issues for the Web Audio API.