From 7037baf0a17965475ec491797a3c7ba739fa4924 Mon Sep 17 00:00:00 2001 From: fabiofumarola Date: Tue, 11 Mar 2014 17:17:45 +0100 Subject: [PATCH] Escalate exception in Image extraction In the method crawl, when there is an exception during the extraction of the main image, it is probably better to throw the original exception outside. Basing on this approach it is possible to wrap the exception in a Try block and then handle it outside the library. --- src/main/scala/com/gravity/goose/Crawler.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/scala/com/gravity/goose/Crawler.scala b/src/main/scala/com/gravity/goose/Crawler.scala index 4f3b32344..2dbce1a1d 100644 --- a/src/main/scala/com/gravity/goose/Crawler.scala +++ b/src/main/scala/com/gravity/goose/Crawler.scala @@ -88,7 +88,8 @@ class Crawler(config: Configuration) { } } catch { case e: Exception => { - warn(e, e.toString) + warn(e, e.getMessage) + throw e } } } @@ -174,4 +175,4 @@ class Crawler(config: Configuration) { object Crawler extends Logging { val logPrefix = "crawler: " -} \ No newline at end of file +}