summaryrefslogtreecommitdiffstats
path: root/org/madore/damlengine/TodoDamlElement.java
diff options
context:
space:
mode:
authorDavid A. Madore <david+git@madore.org>2010-04-19 08:50:41 +0200
committerDavid A. Madore <david+git@madore.org>2010-04-19 08:50:41 +0200
commitc8808d230a8c4f938b6adb54eb250299a092d87c (patch)
tree5661595980ee7d2e33a718162a9e9a0c52ec63b8 /org/madore/damlengine/TodoDamlElement.java
parent4076342660f63f41bd5d25479c8e8588bbaaf3ae (diff)
downloaddamlengine-c8808d230a8c4f938b6adb54eb250299a092d87c.tar.gz
damlengine-c8808d230a8c4f938b6adb54eb250299a092d87c.tar.bz2
damlengine-c8808d230a8c4f938b6adb54eb250299a092d87c.zip
Use RuntimeException classes rather than Error to indicate errors.
Diffstat (limited to 'org/madore/damlengine/TodoDamlElement.java')
-rw-r--r--org/madore/damlengine/TodoDamlElement.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/org/madore/damlengine/TodoDamlElement.java b/org/madore/damlengine/TodoDamlElement.java
index e7b9527..d177998 100644
--- a/org/madore/damlengine/TodoDamlElement.java
+++ b/org/madore/damlengine/TodoDamlElement.java
@@ -25,7 +25,7 @@ public class TodoDamlElement extends TodoDefaultElement {
public void handleNodeOnly() {
if ( ! ( options instanceof DamlEngine.RootOptions ) )
- throw new Error("daml node can only be root node");
+ throw new IllegalArgumentException("daml node can only be root node");
final String uriToTopName = "uri-to-top";
if ( node.hasAttributeNS(null, uriToTopName) )
ctx.uriToTop = node.getAttributeNS(null, uriToTopName);
@@ -34,7 +34,7 @@ public class TodoDamlElement extends TodoDefaultElement {
ctx.fileName = node.getAttributeNS(null, fileNameName);
if ( ctx.htmlNode != null )
- throw new Error("html node already defined at daml node");
+ throw new IllegalStateException("html node already defined at daml node");
ctx.htmlNode = ctx.doc.createElementNS(DamlEngine.XHTML_NS, "html");
String lang = LangHelper.getLangNorec(node);
if ( lang != null )
@@ -44,7 +44,7 @@ public class TodoDamlElement extends TodoDefaultElement {
ctx.htmlNode.appendChild(ctx.doc.createComment(" This file is automatically generated. Do not edit! "));
ctx.htmlNode.appendChild(ctx.doc.createTextNode("\n"));
if ( ctx.headNode != null )
- throw new Error("head node already defined at daml node");
+ throw new IllegalStateException("head node already defined at daml node");
ctx.headNode = ctx.doc.createElementNS(DamlEngine.XHTML_NS, "head");
ctx.htmlNode.appendChild(ctx.headNode);
ctx.htmlNode.appendChild(ctx.doc.createTextNode("\n"));
@@ -92,7 +92,7 @@ public class TodoDamlElement extends TodoDefaultElement {
} else if ( child.getNodeType() == Node.TEXT_NODE
|| child.getNodeType() == Node.CDATA_SECTION_NODE ) {
if ( ! Pattern.matches("^\\s*$",((CharacterData)child).getData()) )
- throw new Error("daml element cannot contain text");
+ throw new IllegalArgumentException("daml element cannot contain text");
}
}
this.ownerDeque.registerAtStart(toProcess);