Skip to content

Commit

Permalink
fix for --datastore-fields w/localckan when datastore table missing
Browse files Browse the repository at this point in the history
  • Loading branch information
wardi committed Sep 15, 2021
1 parent ceb31b3 commit 7ae4062
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ckanapi/datapackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import slugify

from ckanapi.cli.utils import pretty_json
from ckanapi.errors import CKANAPIError
from ckanapi.errors import CKANAPIError, NotFound

DL_CHUNK_SIZE = 100 * 1024
DATAPACKAGE_TYPES = { # map datastore types to datapackage types
Expand Down Expand Up @@ -129,7 +129,9 @@ def populate_datastore_res_fields(ckan, res):
'resource_id': res['id'],
'limit':0})
except CKANAPIError:
pass
return
except NotFound:
return # with localckan we'll get the real CKAN exception not a CKANAPIError subclass
res['datastore_fields'] = ds['fields']


Expand Down

0 comments on commit 7ae4062

Please sign in to comment.