Skip to content

Commit 7ae4062

Browse files
committed
fix for --datastore-fields w/localckan when datastore table missing
1 parent ceb31b3 commit 7ae4062

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ckanapi/datapackage.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import slugify
77

88
from ckanapi.cli.utils import pretty_json
9-
from ckanapi.errors import CKANAPIError
9+
from ckanapi.errors import CKANAPIError, NotFound
1010

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

135137

0 commit comments

Comments
 (0)