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 29928 - map:merge, error codes
Summary: map:merge, error codes
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 3.1 (show other bugs)
Version: Working drafts
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-11 09:40 UTC by Christian Gruen
Modified: 2016-10-26 09:22 UTC (History)
1 user (show)

See Also:


Attachments

Description Christian Gruen 2016-10-11 09:40:55 UTC
A minor issue: The error codes for the map:merge function have been adopted from the JSON function errors. As custom codes exist for other functions, such as e.g. the array functions (FOAY....), wouldn’t it make sense to use custom codes for map functions as well (FOMA0001, etc.), or to give the existing code a more general name?
Comment 1 Michael Kay 2016-10-18 15:34:18 UTC
Decided not to change the error codes (there's no fundamental principle behind these codes that we are violating), but to update the non-normative error descriptions.
Comment 2 Andrew Coleman 2016-10-20 17:59:28 UTC
Action A-657-04 opened to track this.
Comment 3 Michael Kay 2016-10-25 11:30:42 UTC
I have updated the non-normative error descriptions in appendix A.2 as follows:

<error class="JS" code="0001" label="JSON syntax error." type="dynamic">
<p diff="add" at="A">Raised by functions such as <code>fn:json-doc</code>, <code>fn:parse-json</code> <phrase diff="add" at="D">or <code>fn:json-to-xml</code></phrase> if the string supplied as input does not conform to the JSON grammar (optionally with implementation-defined extensions).</p></error>
            
<error class="JS" code="0003" label="JSON duplicate keys." type="dynamic"><p diff="add" at="A">Raised by functions such as <code>map:merge</code>, <code>fn:json-doc</code>, <code>fn:parse-json</code> <phrase diff="add" at="D">or <code>fn:json-to-xml</code></phrase>  if the input contains duplicate keys, when the chosen policy is to reject duplicates.</p></error>
            
<error class="JS" code="0004" label="JSON: not schema-aware." type="dynamic"><p diff="add" at="D">Raised by <code>fn:json-to-xml</code> if validation is requested when the processor does not support schema validation or typed nodes.</p></error>
            
<error class="JS" code="0005" label="Invalid options." type="dynamic"><p diff="add" at="D">Raised by functions such as <code>map:merge</code>, <code>fn:parse-json</code>, and <code>fn:xml-to-json</code> if the <code>$options</code> map contains an invalid entry.</p></error>
            
<error class="JS" code="0006" label="Invalid XML representation of JSON." type="dynamic"><p diff="add" at="D">Raised by <code>fn:xml-to-json</code> if the XML input does not conform to the rules for the XML representation of JSON.</p></error>
            
<error class="JS" code="0007" label="Bad JSON escape sequence." type="dynamic"><p diff="add" at="D">Raised by <code>fn:xml-to-json</code> if the XML input uses the attribute<code>escaped="true"</code> or <code>escaped-key="true"</code>, and the corresponding string or key contains an invalid JSON escape sequence.</p></error>