Skip to content

Commit

Permalink
Handle errors when creating changesets (#687)
Browse files Browse the repository at this point in the history
  • Loading branch information
willemarcel authored Apr 16, 2024
1 parent 2540775 commit 53e1ed1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion osmchadjango/changeset/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from yaml import Loader

from django.conf import settings
from django.db.utils import IntegrityError

import requests
from requests_oauthlib import OAuth1Session
Expand Down Expand Up @@ -52,7 +53,11 @@ def get_filter_changeset_file(url, geojson_filter=settings.CHANGESETS_FILTER):
cl = ChangesetList(url, geojson_filter)
for c in cl.changesets:
print("Creating changeset {}".format(c["id"]))
create_changeset(c["id"])
try:
create_changeset(c["id"])
except IntegrityError as e:
print("IntegrityError when importing {}.".format(c["id"]))
print(e)


def format_url(n):
Expand Down

0 comments on commit 53e1ed1

Please sign in to comment.