From 5f106c9c69abfc8a264be9cad3f25b714d6823af Mon Sep 17 00:00:00 2001 From: zhangheng09 Date: Sat, 12 Mar 2016 20:03:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=93page=E4=B8=BAnull=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E6=84=8F=E5=91=B3=E7=9D=80=E9=9D=9E=E6=AD=A3=E5=B8=B8=E7=9A=84?= =?UTF-8?q?=E5=93=8D=E5=BA=94=E7=8A=B6=E6=80=81=EF=BC=8C=E5=BA=94=E8=AF=A5?= =?UTF-8?q?=E6=8A=9B=E5=87=BA=E5=BC=82=E5=B8=B8=EF=BC=8C=E5=90=A6=E5=88=99?= =?UTF-8?q?SpiderListener=E7=9A=84onSuccess=E6=96=B9=E6=B3=95=E5=92=8ConEr?= =?UTF-8?q?ror=E6=96=B9=E6=B3=95=E9=83=BD=E4=BC=9A=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webmagic-core/src/main/java/us/codecraft/webmagic/Spider.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/webmagic-core/src/main/java/us/codecraft/webmagic/Spider.java b/webmagic-core/src/main/java/us/codecraft/webmagic/Spider.java index 0fd770d..d62130b 100644 --- a/webmagic-core/src/main/java/us/codecraft/webmagic/Spider.java +++ b/webmagic-core/src/main/java/us/codecraft/webmagic/Spider.java @@ -408,9 +408,7 @@ public class Spider implements Runnable, Task { protected void processRequest(Request request) { Page page = downloader.download(request, this); if (page == null) { - sleep(site.getRetrySleepTime()); - onError(request); - return; + throw new RuntimeException("unaccpetable response status"); } // for cycle retry if (page.isNeedCycleRetry()) {