Skip to content

Commit 9ea1069

Browse files
authored
Merge pull request #136 from evolvedbinary/7.x.x/hotfix/xdm-error-compatibility
[7.x.x] Restore compatibility with EXPath Crypto Module
2 parents 3b03980 + 42f92c0 commit 9ea1069

File tree

35 files changed

+555
-486
lines changed

35 files changed

+555
-486
lines changed

exist-core/src/main/java/org/exist/http/RESTServer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1523,7 +1523,7 @@ private void declareExternalAndXQJVariables(final XQueryContext context,
15231523
}
15241524

15251525
if (localname == null) {
1526-
throw new XPathException(ErrorCodes.W3CErrorCode.XPDY0002, String.format("External variable is missing local name in its qualified name. Prefix=%s URI=%s", prefix, uri));
1526+
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));
15271527
}
15281528

15291529
if (uri == null && prefix != null) {
@@ -1538,7 +1538,7 @@ private void declareExternalAndXQJVariables(final XQueryContext context,
15381538
}
15391539

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

15441544
if (uri != null && prefix != null) {

exist-core/src/main/java/org/exist/xmldb/LocalXPathQueryService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,11 +434,11 @@ protected void declareVariables(final XQueryContext context) throws XPathExcepti
434434
try {
435435
varName = QName.parse(context, varNameStr);
436436
} catch (final QName.IllegalQNameException e) {
437-
throw new XPathException(org.exist.xquery.ErrorCodes.W3CErrorCode.XPST0081, "Error declaring variable, invalid qname: " + varNameStr + ". " + e.getMessage(), e);
437+
throw new XPathException(org.exist.xquery.ErrorCodes.W3CErrorCode.XPST0081.getErrorCode(), "Error declaring variable, invalid qname: " + varNameStr + ". " + e.getMessage(), e);
438438
}
439439

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

444444
context.declareVariable(varName, true, entry.getValue());

exist-core/src/main/java/org/exist/xmldb/RemoteXPathQueryService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ private XPathException errorToXPathException(final Map result) {
204204
final QName qname = new QName(localPart, namespaceUri, prefix);
205205
errorCode = org.exist.xquery.ErrorCodes.fromQName(qname);
206206
} else {
207-
errorCode = org.exist.xquery.ErrorCodes.EXistErrorCode.ERROR;
207+
errorCode = org.exist.xquery.ErrorCodes.EXistErrorCode.ERROR.getErrorCode();
208208
}
209209

210210
return new XPathException(line, column, errorCode, message);

exist-core/src/main/java/org/exist/xmlrpc/RpcConnection.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,11 @@ protected QueryResult doQuery(final DBBroker broker, final CompiledXQuery compil
279279
try {
280280
varName = QName.parse(context, varNameStr);
281281
} catch (final QName.IllegalQNameException e) {
282-
throw new XPathException(org.exist.xquery.ErrorCodes.W3CErrorCode.XPST0081, "Error declaring variable, invalid qname: " + varNameStr + ". " + e.getMessage(), e);
282+
throw new XPathException(org.exist.xquery.ErrorCodes.W3CErrorCode.XPST0081.getErrorCode(), "Error declaring variable, invalid qname: " + varNameStr + ". " + e.getMessage(), e);
283283
}
284284

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

289289
if (LOG.isDebugEnabled()) {

0 commit comments

Comments
 (0)