This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 19595 - Use NotSupportedError for unsupported labels
Summary: Use NotSupportedError for unsupported labels
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: Encoding (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: Unsorted
Assignee: Anne
QA Contact: sideshowbarker+encodingspec
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-18 09:45 UTC by Simon Pieters
Modified: 2012-10-30 17:13 UTC (History)
3 users (show)

See Also:


Attachments

Description Simon Pieters 2012-10-18 09:45:03 UTC
http://encoding.spec.whatwg.org/#interface-textencoder

[[
If encoding is failure, or is none of
 utf-8, utf-16, and utf-16be,
 throw a
 "EncodingError".
]]

I think it makes more sense to throw NotSupportedError here. Similarly for TextDecoder constructor's step 2.
Comment 1 Anne 2012-10-18 09:46:20 UTC
sicking, jsbell, what do you guys think?
Comment 2 Anne 2012-10-18 12:45:29 UTC
Actually, maybe we should throw the exception that is thrown for enums. I'm a bit hesitant to make both into an actual enum, but those are the semantics.
Comment 3 Anne 2012-10-18 12:46:38 UTC
Which would be TypeError.