From b978c26e70fa61024fcac2982a37782571b720a3 Mon Sep 17 00:00:00 2001 From: Stefan Oderbolz Date: Thu, 15 Jan 2015 00:49:11 +0100 Subject: [PATCH] Use ContentFetchError instead of generic Exception --- ckanext/harvest/harvesters/ckanharvester.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ckanext/harvest/harvesters/ckanharvester.py b/ckanext/harvest/harvesters/ckanharvester.py index a5b3f32..70018ae 100644 --- a/ckanext/harvest/harvesters/ckanharvester.py +++ b/ckanext/harvest/harvesters/ckanharvester.py @@ -177,7 +177,7 @@ class CKANHarvester(HarvesterBase): url = base_rest_url + '/revision/%s' % revision_id try: content = self._get_content(url) - except Exception,e: + except ContentFetchError,e: self._save_gather_error('Unable to get content for URL: %s: %s' % (url, str(e)),harvest_job) continue @@ -204,7 +204,7 @@ class CKANHarvester(HarvesterBase): url = base_rest_url + '/package' try: content = self._get_content(url) - except Exception,e: + except ContentFetchError,e: self._save_gather_error('Unable to get content for URL: %s: %s' % (url, str(e)),harvest_job) return None @@ -241,7 +241,7 @@ class CKANHarvester(HarvesterBase): # Get contents try: content = self._get_content(url) - except Exception,e: + except ContentFetchError,e: self._save_object_error('Unable to get content for package: %s: %r' % \ (url, e),harvest_object) return None