Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions exist-core/src/main/java/org/exist/http/RESTServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -1501,7 +1501,7 @@ private void declareExternalAndXQJVariables(final XQueryContext context,
}

if (localname == null) {
throw new XPathException(ErrorCodes.W3CErrorCode.XPDY0002, String.format("External variable is missing local name in its qualified name. Prefix=%s URI=%s", prefix, uri));
throw new XPathException(ErrorCodes.W3CErrorCode.XPDY0002.getErrorCode(), String.format("External variable is missing local name in its qualified name. Prefix=%s URI=%s", prefix, uri));
}

if (uri == null && prefix != null) {
Expand All @@ -1516,7 +1516,7 @@ private void declareExternalAndXQJVariables(final XQueryContext context,
}

if (!context.isExternalVariableDeclared(q)) {
throw new XPathException(ErrorCodes.W3CErrorCode.XPDY0002, "External variable " + q + " is not declared in the XQuery");
throw new XPathException(ErrorCodes.W3CErrorCode.XPDY0002.getErrorCode(), "External variable " + q + " is not declared in the XQuery");
}

if (uri != null && prefix != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,11 +431,11 @@ protected void declareVariables(final XQueryContext context) throws XPathExcepti
try {
varName = QName.parse(context, varNameStr);
} catch (final QName.IllegalQNameException e) {
throw new XPathException(org.exist.xquery.ErrorCodes.W3CErrorCode.XPST0081, "Error declaring variable, invalid qname: " + varNameStr + ". " + e.getMessage(), e);
throw new XPathException(org.exist.xquery.ErrorCodes.W3CErrorCode.XPST0081.getErrorCode(), "Error declaring variable, invalid qname: " + varNameStr + ". " + e.getMessage(), e);
}

if (!context.isExternalVariableDeclared(varName)) {
throw new XPathException(org.exist.xquery.ErrorCodes.W3CErrorCode.XPDY0002, "External variable " + varName + " is not declared in the XQuery");
throw new XPathException(org.exist.xquery.ErrorCodes.W3CErrorCode.XPDY0002.getErrorCode(), "External variable " + varName + " is not declared in the XQuery");
}

context.declareVariable(varName, true, entry.getValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ private XPathException errorToXPathException(final Map result) {
final QName qname = new QName(localPart, namespaceUri, prefix);
errorCode = org.exist.xquery.ErrorCodes.fromQName(qname);
} else {
errorCode = org.exist.xquery.ErrorCodes.EXistErrorCode.ERROR;
errorCode = org.exist.xquery.ErrorCodes.EXistErrorCode.ERROR.getErrorCode();
}

return new XPathException(line, column, errorCode, message);
Expand Down
4 changes: 2 additions & 2 deletions exist-core/src/main/java/org/exist/xmlrpc/RpcConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,11 @@ protected QueryResult doQuery(final DBBroker broker, final CompiledXQuery compil
try {
varName = QName.parse(context, varNameStr);
} catch (final QName.IllegalQNameException e) {
throw new XPathException(org.exist.xquery.ErrorCodes.W3CErrorCode.XPST0081, "Error declaring variable, invalid qname: " + varNameStr + ". " + e.getMessage(), e);
throw new XPathException(org.exist.xquery.ErrorCodes.W3CErrorCode.XPST0081.getErrorCode(), "Error declaring variable, invalid qname: " + varNameStr + ". " + e.getMessage(), e);
}

if (!context.isExternalVariableDeclared(varName)) {
throw new XPathException(org.exist.xquery.ErrorCodes.W3CErrorCode.XPDY0002, "External variable " + varName + " is not declared in the XQuery");
throw new XPathException(org.exist.xquery.ErrorCodes.W3CErrorCode.XPDY0002.getErrorCode(), "External variable " + varName + " is not declared in the XQuery");
}

if (LOG.isDebugEnabled()) {
Expand Down
Loading