From c8808d230a8c4f938b6adb54eb250299a092d87c Mon Sep 17 00:00:00 2001 From: "David A. Madore" Date: Mon, 19 Apr 2010 08:50:41 +0200 Subject: Use RuntimeException classes rather than Error to indicate errors. --- org/madore/damlengine/TodoBodyElement.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'org/madore/damlengine/TodoBodyElement.java') diff --git a/org/madore/damlengine/TodoBodyElement.java b/org/madore/damlengine/TodoBodyElement.java index c2be164..c5cc6c8 100644 --- a/org/madore/damlengine/TodoBodyElement.java +++ b/org/madore/damlengine/TodoBodyElement.java @@ -22,7 +22,7 @@ public class TodoBodyElement extends TodoDefaultElement { public void handleNodeOnly() { if ( ! ( options instanceof TodoDamlElement.DamlOptions ) ) - throw new Error("body node can only be child of daml node"); + throw new IllegalArgumentException("body node can only be child of daml node"); Element bodyNode = ctx.doc.createElementNS(DamlEngine.XHTML_NS, "body"); String lang = LangHelper.getLangNorec(node); @@ -53,7 +53,7 @@ public class TodoBodyElement extends TodoDefaultElement { if ( child.getNodeType() == Node.TEXT_NODE || child.getNodeType() == Node.CDATA_SECTION_NODE ) { if ( ! Pattern.matches("^\\s*$",((CharacterData)child).getData()) ) - throw new Error("body element cannot contain text"); + throw new IllegalArgumentException("body element cannot contain text"); } bodyNode.appendChild(child); if ( child.getNodeType() == Node.ELEMENT_NODE ) { -- cgit v1.2.3