Skip to content

Commit 07a16ff

Browse files
committed
better error handling and some tests
1 parent b24a078 commit 07a16ff

File tree

2 files changed

+395
-52
lines changed

2 files changed

+395
-52
lines changed

src/main/java/org/htmlunit/javascript/host/Element.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ public String getInnerHTML() {
859859
return getInnerHTML(domNode);
860860
}
861861
catch (final IllegalStateException e) {
862-
throw JavaScriptEngine.throwAsScriptRuntimeEx(e);
862+
throw JavaScriptEngine.typeError(e.getMessage());
863863
}
864864
}
865865

@@ -874,7 +874,7 @@ public void setInnerHTML(final Object value) {
874874
domNode = getDomNodeOrDie();
875875
}
876876
catch (final IllegalStateException e) {
877-
throw JavaScriptEngine.throwAsScriptRuntimeEx(e);
877+
throw JavaScriptEngine.typeError(e.getMessage());
878878
}
879879

880880
String html = null;

0 commit comments

Comments
 (0)