From 4e6e946dd7860f0e6291c3dd96ffd699c174c983 Mon Sep 17 00:00:00 2001 From: "yihua.huang" Date: Wed, 13 Aug 2014 10:02:16 +0800 Subject: [PATCH] more friendly exception message in PlainText #144 --- .../java/us/codecraft/webmagic/selector/PlainText.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/webmagic-core/src/main/java/us/codecraft/webmagic/selector/PlainText.java b/webmagic-core/src/main/java/us/codecraft/webmagic/selector/PlainText.java index 557763b1..c78f6791 100644 --- a/webmagic-core/src/main/java/us/codecraft/webmagic/selector/PlainText.java +++ b/webmagic-core/src/main/java/us/codecraft/webmagic/selector/PlainText.java @@ -29,27 +29,27 @@ public class PlainText extends AbstractSelectable { @Override public Selectable xpath(String xpath) { - throw new UnsupportedOperationException(); + throw new UnsupportedOperationException("XPath can not apply to plain text. Please check whether you use a previous xpath with attribute select (/@href etc)."); } @Override public Selectable $(String selector) { - throw new UnsupportedOperationException(); + throw new UnsupportedOperationException("$ can not apply to plain text. Please check whether you use a previous xpath with attribute select (/@href etc)."); } @Override public Selectable $(String selector, String attrName) { - throw new UnsupportedOperationException(); + throw new UnsupportedOperationException("$ can not apply to plain text. Please check whether you use a previous xpath with attribute select (/@href etc)."); } @Override public Selectable smartContent() { - throw new UnsupportedOperationException(); + throw new UnsupportedOperationException("Smart content can not apply to plain text. Please check whether you use a previous xpath with attribute select (/@href etc)."); } @Override public Selectable links() { - throw new UnsupportedOperationException(); + throw new UnsupportedOperationException("Links can not apply to plain text. Please check whether you use a previous xpath with attribute select (/@href etc)."); } @Override