Skip to content

Commit

Permalink
fix string formatting for DuplicateRecordError
Browse files Browse the repository at this point in the history
  • Loading branch information
v0lat1le committed Jul 8, 2016
1 parent 2e206b5 commit 78b2f17
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions datacube/index/postgres/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def insert_dataset(self, metadata_doc, dataset_id, dataset_type_id):
return ret.rowcount > 0
except IntegrityError as e:
if e.orig.pgcode == PGCODE_UNIQUE_CONSTRAINT:
raise DuplicateRecordError('Duplicate dataset, not inserting: %s', dataset_id)
raise DuplicateRecordError('Duplicate dataset, not inserting: %s' % dataset_id)
raise

def ensure_dataset_location(self, dataset_id, uri):
Expand All @@ -231,7 +231,7 @@ def ensure_dataset_location(self, dataset_id, uri):
)
except IntegrityError as e:
if e.orig.pgcode == PGCODE_UNIQUE_CONSTRAINT:
raise DuplicateRecordError('Location already exists: %s', uri)
raise DuplicateRecordError('Location already exists: %s' % uri)
raise

def contains_dataset(self, dataset_id):
Expand Down

0 comments on commit 78b2f17

Please sign in to comment.