Permalink
Browse files

Added standard error codes for parsing functions.

  • Loading branch information...
claudius108 committed Mar 2, 2014
1 parent 861e29b commit d88fe5821916f788e042d9b3fe2f61a5332600b8
Showing with 5 additions and 2 deletions.
  1. +3 −0 src/org/exist/xquery/ErrorCodes.java
  2. +2 −2 src/org/exist/xquery/functions/fn/ParsingFunctions.java
@@ -193,6 +193,9 @@
public static final ErrorCode XTDE1310 = new W3CErrorCode("XTDE1310", " Invalid decimal format picture string.");
public static final ErrorCode FTDY0020 = new W3CErrorCode("FTDY0020", "");
+
+ public static final ErrorCode FODC0006 = new W3CErrorCode("FODC0006", "String passed to fn:parse-xml is not a well-formed XML document.");
+
/* eXist specific XQuery and XPath errors
*
@@ -119,7 +119,7 @@ public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathExce
} catch (final SAXException e) {
logger.debug("Error while parsing XML: " + e.getMessage(), e);
} catch (final IOException e) {
- throw new XPathException(this, ErrorCodes.EXXQDY0002, "Error while parsing XML: " + e.getMessage(),
+ throw new XPathException(this, ErrorCodes.FODC0006, "Error while parsing XML: " + e.getMessage(),
args[0], e);
}
@@ -139,7 +139,7 @@ public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathExce
} else {
final MemTreeBuilder builder = context.getDocumentBuilder();
final NodeImpl result = Shared.writeReport(report, builder);
- throw new XPathException(this, ErrorCodes.EXXQDY0002, report.toString(), result);
+ throw new XPathException(this, ErrorCodes.FODC0006, report.toString(), result);
}
}
}

0 comments on commit d88fe58

Please sign in to comment.