Skip to content

Commit

Permalink
Merge pull request #154 from datosgobar/bugfix-harvest-catalog
Browse files Browse the repository at this point in the history
Agrego catcheo de excepciones de validación en harvest_catalog
  • Loading branch information
poligarcia committed Apr 25, 2018
2 parents 4dd0841 + 93fe03a commit 107b656
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pydatajson/federation.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
from __future__ import print_function
import logging
from ckanapi import RemoteCKAN
from ckanapi.errors import NotFound, NotAuthorized
from ckanapi.errors import NotFound, NotAuthorized, ValidationError
from .ckan_utils import map_dataset_to_package, map_theme_to_group
from .search import get_datasets

logger = logging.getLogger(__name__)


def push_dataset_to_ckan(catalog, owner_org, dataset_origin_identifier,
portal_url, apikey, catalog_id=None,
demote_superThemes=True, demote_themes=True):
Expand Down Expand Up @@ -262,7 +263,7 @@ def harvest_catalog_to_ckan(catalog, portal_url, apikey, catalog_id,
harvested_id = harvest_dataset_to_ckan(
catalog, owner_org, dataset_id, portal_url, apikey, catalog_id)
harvested.append(harvested_id)
except (NotAuthorized, NotFound, KeyError, TypeError) as e:
except (ValidationError, NotAuthorized, NotFound, KeyError, TypeError) as e:
logger.error("Error federando catalogo:"+catalog_id+", dataset:"+dataset_id + "al portal: "+portal_url)
logger.error(str(e))

Expand Down

0 comments on commit 107b656

Please sign in to comment.