catch a throwable in datastore crawl

This commit is contained in:
yfujita 2016-04-06 14:02:22 +09:00
parent e8319c44f6
commit 6d36baa952
2 changed files with 2 additions and 2 deletions

View file

@ -266,7 +266,7 @@ public class CsvDataStoreImpl extends AbstractDataStoreImpl {
}
final FailureUrlService failureUrlService = ComponentUtil.getComponent(FailureUrlService.class);
failureUrlService.store(dataConfig, errorName, url, target);
} catch (final Exception e) {
} catch (final Exception | OutOfMemoryError e) {
final String url = csvFile.getAbsolutePath() + ":" + csvReader.getLineNumber();
final FailureUrlService failureUrlService = ComponentUtil.getComponent(FailureUrlService.class);
failureUrlService.store(dataConfig, e.getClass().getCanonicalName(), url, e);

View file

@ -233,7 +233,7 @@ public class DataIndexHelper implements Serializable {
} else {
try {
dataStore.store(dataConfig, indexUpdateCallback, initParamMap);
} catch (final Exception e) {
} catch (final Throwable e) {
logger.error("Failed to process a data crawling: " + dataConfig.getName(), e);
ComponentUtil.getComponent(FailureUrlService.class).store(dataConfig, e.getClass().getCanonicalName(),
dataConfig.getConfigId() + ":" + dataConfig.getName(), e);