Changes

Jump to navigation Jump to search
2,545 bytes added ,  17:06, 22 November 2017
no edit summary
This article is part of the [[XQuery|XQuery Portal]].It summarizes all error the codes of errors that may be thrown are raised by the BaseX standard features and functions of XQuery processor. As the original specifications are pretty comprehensive, we tried our best to make this overview comprehensible to a wider range of readers.
As the original specifications are rather bulky and meticulous, we tried our best to make this overview comprehensible to a widerrange of readers. The following tables list the error codes thatare known to BaseX, a short description, and examples of queriesraising that errors. Errors that are specific to BaseX can be found in the descriptions of the respective [[Module Library|modules]].
Original definitions of the error codes are found in the[http://www.w3.org/TR/xquery-30/ XQuery 3.0],[http://www.w3.org/TR/xpath-functions-30/ XQuery 3.0 Functions],[http://www.w3.org/TR/xquery-update-10/ XQuery 1.0 Update],[http://www.w3.org/TR/xpath-full-text-10/ XQuery 1.0 Full Text],and [http://www.expath.org/spec/http-client EXPath HTTP]Specifications.
==BaseX Static Errors==
Error * Namespace URI: <code><nowiki>http://www.w3.org/2005/xqt-errors</nowiki></code>* Namespace prefix: <code>err</code>* Codes: {{Code|BASXXPST}}, {{Code|XQST}}
{| class="wikitable" width="100%"
! width="5%"|Code! width="60%"|Description! width="35%"|Examples|- valign="top" scope="row"|<code>BASX0000</code>| Generic error, which is used for exceptions in [[Java Bindings#Context-Awareness|context-aware Java bindings]].||- valign="top" scope="row"|<code>BASX0001</code>| The current user has insufficient [[User Management|permissions]] to execute an expression.|<code>file:delete('file.txt')</code>: ''Create'' rights needed.|- valign="top" scope="row"|<code>BASX0002</code>| The specified database option is unknown.|<code>declare option db:xyz "no"; 1</code>|} Additional, module-specific error codes are listed in the descriptions of the query modules. ==Static Errors== Error Codes: {{Code|XPST}}, {{Code|XQST}} {| class="wikitable" width="100%"! width="5%110"|Code! width="6050%"|Description! width="45%"|Examples
|- valign="top" scope="row"
|<code>XPST0003</code>
|- valign="top" scope="row"
|<code>XPST0005</code>
|An expression will never return any results, no matter what input will be processedis provided.
|<code>doc('input')/..</code>
|- valign="top" scope="row"
|- valign="top" scope="row"
|<code>XPST0017</code>
| • The specified function is unknown, or<br />• it uses the wrong number of arguments, or, when calling Java functions:<br />• there is more than one function with the same number of arguments.
|<code>unknown()<hr/>count(1,2,3)</code>
|- valign="top" scope="row"
|<code>declare context item ...</code>
|- valign="top" scope="row"
|<code>XQST0107XQST0106</code>| The initializer of the context item depends on itselfAn annotation has been declared twice in a variable or function declaration.|<code>declare context item := %updating %updating function ...; ()</code>
|- valign="top" scope="row"
|<code>XQST0108</code>
|<code>XQST0113</code>
| Context item values may only be in the main module.
|Module: {{Code|<code>declare context item := 1;}}</code>
|- valign="top" scope="row"
|<code>XQST0114</code>
|}
==Type Errors==
Error * Namespace URI: <code><nowiki>http://www.w3.org/2005/xqt-errors</nowiki></code>* Namespace prefix: <code>err</code>* Codes: {{Code|XPTY}}, {{Code|XQTY}}
{| class="wikitable" width="100%"
! width="5%110"|Code! width="6050%"|Description! width="45%"|Examples
|- valign="top" scope="row"
|<code>XPTY0004</code>
| An attribute node cannot be bound to its parent element, as other nodes of a different type were specified before.
|<code><elem>text { attribute a { "val" } }</elem></code>
|- valign="top" scope="row"
|<code>XQTY0105</code>
| A function item has been specified as content of an element.
|<code><X>{ false#0 }</X></code>
|}
==Dynamic Errors==
Error * Namespace URI: <code><nowiki>http://www.w3.org/2005/xqt-errors</nowiki></code>* Namespace prefix: <code>err</code>* Codes: {{Code|XPDY}}, {{Code|XQDY}}
{| class="wikitable" width="100%"
! width="5%110"|Code! width="6050%"|Description! width="35%"|Examples
|- valign="top" scope="row"
|<code>XPDY0002</code>
|<code>processing-instruction { "1" } { "" }</code>
|- valign="top" scope="row"
|<code>XQDY0043XQDY0044</code>
| The node name of an attribute uses reserved prefixes or namespaces.
|<code>attribute xmlns { "etc" }</code>
| The node name of an element uses reserved prefixes or namespaces.
|<code>element { QName("uri", "xml:n") } {}</code>
|- valign="top" scope="row"
|<code>XQDY0101</code>
| Invalid namespace declaration.
|<code>namespace xmlns { 'x' }</code>
|- valign="top" scope="row"
|<code>XQDY0102</code>
| Duplicate namespace declaration.
|<code>element x { namespace a {'b'}, namespace a {'c'} }</code>
|}
==Functions Errors==
Error * Namespace URI: <code><nowiki>http://www.w3.org/2005/xqt-errors</nowiki></code>* Namespace prefix: <code>err</code>* Codes: {{Code|FOAR}}, {{Code|FOCA}}, {{Code|FOCH}}, {{Code|FODC}}, {{Code|FODF}}, {{Code|FODT}}, {{Code|FOER}}, {{Code|FOFD}}, {{Code|FONS}}, {{Code|FORG}}, {{Code|FORX}}, {{Code|FOTY}}, {{Code|FOUT}}
{| class="wikitable" width="100%"
! width="5%110"|Code! width="50%"|Description! width="45%"|Examples
|- valign="top" scope="row"
|<code>FOAR0001</code>
|-
| colspan=3 style="background-color:white;"|
|- valign="top" scope="row"
|<code>FODT0001</code>
| An arithmetic duration operation causes an over- or underflow.
|<code>xs:date('2000-01-01') + xs:duration('P99999Y')</code>
|- valign="top" scope="row"
|<code>FODT0002</code>
|<code>FOTY0012</code>
| An item has no typed value.
|<code>count#1</code>
|- valign="top" scope="row"
|<code>FOTY0013</code>
| Functions items cannot be atomized, have no defined equality, and have no string representation.
|<code>data(false#0)</code>
|- valign="top" scope="row"
|<code>FOTY0014</code>
| Function items have no string representation.
|<code>string(map {})</code>
|- valign="top" scope="row"
|<code>FOTY0015</code>
| Function items cannot be compared.
|<code>deep-equal(false#0, true#0)</code>
|-
| colspan=3 style="background-color:white;"|
|<code>FOUT1170</code>
| Function argument cannot be used to retrieve a text resource.
|<code>unparsed-text(':')</code>
|- valign="top" scope="row"
|<code>FOUT1170FOUT1190</code>
| Encoding to retrieve a text resource is invalid or not supported.
|<code>unparsed-text('file.txt', 'InvalidEncoding')</code>
|}
....to be added: FOTY0012-0015 ==Serialization Errors==
Error * Namespace URI: <code><nowiki>http://www.w3.org/2005/xqt-errors</nowiki></code>* Namespace prefix: <code>err</code>* Codes: {{Code|SEPM}}, {{Code|SERE}}, {{Code|SESU}}
{| class="wikitable" width="100%"
! width="5%110"|Code! width="50%"|Description! width="45%"|Examples
|- valign="top" scope="row"
|<code>SESU0007</code>
| A specified parameter is unknown or has an invalid value.
|<code>declare option output:indent "nope"; 1</code>
|
|- valign="top" scope="row"
|<code>SEPM0017</code>
| The definition of serialization parameter is invalid.
|
|}
==Update Errors==
Error * Namespace URI: <code><nowiki>http://www.w3.org/2005/xqt-errors</nowiki></code>* Namespace prefix: <code>err</code>* Codes: {{Code|FOUP}}, {{Code|XUDY}}, {{Code|XUST}}, {{Code|XUTY}}
{| class="wikitable" width="100%"
! width="5%110"|Code! width="50%"|Description! width="45%"|Examples
|- valign="top" scope="row"
|<code>FOUP0001</code>
|}
==Full-Text Errors==
Error * Namespace URI: <code><nowiki>http://www.w3.org/2005/xqt-errors</nowiki></code>* Namespace prefix: <code>err</code>* Codes: {{Code|FTDY}}, {{Code|FTST}}
{| class="wikitable" width="100%"
! width="5%110"|Code! width="50%"|Description! width="45%"|Examples
|- valign="top" scope="row"
|<code>FTDY0016</code>
|}
=BaseX Errors= * Namespace URI: <code><nowiki>http://basex.org</nowiki></code>* Namespace prefix: <code>basex</code> {| class="wikitable" width="100%"! width="110"|Code!Description!Examples|- valign="top" scope="row"|<code>annotation</code>| Annotation errors.|<code>%basex:xyz function() { 123 }</code>|- valign="top" scope="row"|<code>doc</code>| The argument specified via fn:doc must yield a single document.|<code>doc('db-collection')</code>|- valign="top" scope="row"|<code>error</code>| Generic error, which is e. g. raised by [[CategoryJava Bindings#Integration|Java bindings]].|<code>import module namespace qm='java:XQueryorg.basex.query.func.QueryModuleTest';<br/>qm:error()</code>|- valign="top" scope="row"|<code>function</code>| Function items cannot be cached.|<code>db:output(true#0)</code>|- valign="top" scope="row"|<code>http</code>| The function was called outside an HTTP servlet context.|<code>session:get('abc')</code>|- valign="top" scope="row"|<code>options</code>| The specified database option is unknown.|<code>declare option db:xyz 'no'; 1</code>|- valign="top" scope="row"|<code>overflow</code>| Stack overflow.|<code>declare function local:a() { local:b() + 1 };<br/>declare function local:b() { local:a() + 2 };<br/>local:a()</code>|- valign="top" scope="row"|<code>permission</code>| The current user has insufficient [[User Management|permissions]] to open a database, update nodes, etc.|<code>db:open('admin')</code>|- valign="top" scope="row"|<code>restxq</code>| Errors related to [[RESTXQ]].|<code>%restxq:GET('x')</code>|- valign="top" scope="row"|<code>update</code>| BaseX-specific update errors.|<code><a/> update db:output('bla')</code>|} Additional, module-specific error codes are listed in the descriptions of the query modules.
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu