lewismc commented on code in PR #830:
URL: https://github.com/apache/nutch/pull/830#discussion_r1807956535


##########
src/java/org/apache/nutch/crawl/Injector.java:
##########
@@ -130,23 +130,28 @@ public static class InjectMapper
 
     @Override
     public void setup(Context context) {
-      Configuration conf = context.getConfiguration();
-      boolean normalize = conf.getBoolean(CrawlDbFilter.URL_NORMALIZING, true);
-      boolean filter = conf.getBoolean(CrawlDbFilter.URL_FILTERING, true);
-      filterNormalizeAll = conf.getBoolean(URL_FILTER_NORMALIZE_ALL, false);
-      if (normalize) {
-        scope = conf.get(URL_NORMALIZING_SCOPE, URLNormalizers.SCOPE_INJECT);
-        urlNormalizers = new URLNormalizers(conf, scope);
-      }
-      interval = conf.getInt("db.fetch.interval.default", 2592000);
-      if (filter) {
-        filters = new URLFilters(conf);
+      try {
+        Configuration conf = context.getConfiguration();
+        boolean normalize = conf.getBoolean(CrawlDbFilter.URL_NORMALIZING, 
true);
+        boolean filter = conf.getBoolean(CrawlDbFilter.URL_FILTERING, true);
+        filterNormalizeAll = conf.getBoolean(URL_FILTER_NORMALIZE_ALL, false);
+        if (normalize) {
+          scope = conf.get(URL_NORMALIZING_SCOPE, URLNormalizers.SCOPE_INJECT);
+          urlNormalizers = new URLNormalizers(conf, scope);
+        }
+        interval = conf.getInt("db.fetch.interval.default", 2592000);
+        if (filter) {
+          filters = new URLFilters(conf);
+        }
+        scfilters = new ScoringFilters(conf);
+        scoreInjected = conf.getFloat("db.score.injected", 1.0f);
+        curTime = conf.getLong("injector.current.time",
+            System.currentTimeMillis());
+        url404Purging = conf.getBoolean(CrawlDb.CRAWLDB_PURGE_404, false);
+      } catch (Exception e) {

Review Comment:
   Exception is very vague. I would suggest we figure out what types of 
Exception's are thrown then catch and raise them instead. What do you think 
@HiranChaudhuri  ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@nutch.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to