Skip to content

Commit 7e24d76

Browse files
committed
[examples][s]: skips dataset if publishing failed instead of exiting - fixes #98
1 parent 61b4e68 commit 7e24d76

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

examples/import_git.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,15 @@ def run():
6868
publish_data_package(arguments.link)
6969
elif arguments.type == 'multiple':
7070
urls = get_all_git_url(arguments.link)
71+
failed = []
7172
for k, v in urls.items():
72-
publish_data_package(git_url=v, count=k)
73+
try:
74+
publish_data_package(git_url=v, count=k)
75+
except Exception as e:
76+
failed.append({'dataset': v, 'error': e})
77+
print ('\nWarning: Following datasets were skiped as failed to publish:\n')
78+
for package in failed:
79+
print ('---\n\nDataSet: %s\n\nREASON: %s' %(package.get('dataset'), package.get('error')))
7380

7481
if os.path.isdir(DIR_NAME_PREFIX):
7582
shutil.rmtree(DIR_NAME_PREFIX)

0 commit comments

Comments
 (0)