Skip to content

Commit dac4341

Browse files
committed
NRL-738 fix logs
1 parent d1614a1 commit dac4341

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

api/producer/upsertDocumentReference/upsert_document_reference.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ def handler(
172172
LogReference.PROUPSERT010,
173173
pointer_id=result.resource.id,
174174
ids_to_delete=ids_to_delete,
175+
can_ignore_delete_fail=can_ignore_delete_fail,
175176
)
176177
saved_model = repository.supersede(
177178
core_model, ids_to_delete, can_ignore_delete_fail

layer/nrlf/core/dynamodb/repository.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ def delete_by_id(self, id_: str, can_ignore_delete_fail: bool = False):
422422
partition_key = "D#" + "#".join([*ods_code_parts, document_id])
423423
try:
424424
self.table.delete_item(Key={"pk": partition_key, "sk": partition_key})
425-
except ClientError as exc:
425+
except Exception as exc:
426426
if can_ignore_delete_fail:
427427
logger.log(
428428
LogReference.REPOSITORY026a,

layer/nrlf/core/log_references.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -232,49 +232,49 @@ class LogReference(Enum):
232232
PROUPSERT000 = _Reference(
233233
"INFO", "Starting to process producer upsertDocumentReference"
234234
)
235-
PROUPSERT001 = _Reference("DEBUG", "Upsert - Validating DocumentReference resource")
235+
PROUPSERT001 = _Reference(
236+
"DEBUG", "Validating DocumentReference resource for upsert"
237+
)
236238
PROUPSERT002 = _Reference(
237-
"WARN", "Upsert -DocumentReference resource failed validation"
239+
"WARN", "DocumentReference resource failed validation for upsert"
238240
)
239241
PROUPSERT003 = _Reference(
240-
"WARN", "Upsert - ODS code in headers does not match ODS code in resource ID"
242+
"WARN", "ODS code in headers does not match ODS code in resource ID for upsert"
241243
)
242244
PROUPSERT004 = _Reference(
243245
"WARN",
244-
"Upsert - ODS code in headers does not match ODWS code in resource custodian",
246+
"ODS code in headers does not match ODWS code in resource custodian for upsert",
245247
)
246248
PROUPSERT005 = _Reference(
247-
"WARN", "Upsert - Organisation is not allowed to upsert pointer type"
249+
"WARN", "Organisation is not allowed to upsert pointer type for upsert"
248250
) #
249251
PROUPSERT006 = _Reference(
250-
"DEBUG", "Upsert - Performing relatesTo validation on resource"
252+
"DEBUG", "Performing relatesTo validation on resource for upsert"
251253
)
252254
PROUPSERT007a = _Reference(
253-
"WARN", "Upsert - RelatesTo validation failed - no target identifier value"
255+
"WARN", "RelatesTo validation failed - no target identifier value for upsert"
254256
)
255257
PROUPSERT007b = _Reference(
256258
"WARN",
257-
"Upsert - Upsert - RelatesTo validation failed - invalid producer for target identifier",
259+
"RelatesTo validation failed - invalid producer for target identifier for upsert",
258260
)
259261
PROUPSERT007c = _Reference(
260262
"WARN",
261-
"Upsert - elatesTo validation failed - no pointer exists with target identifier",
263+
"RelatesTo validation failed - no pointer exists with target identifier for upsert",
262264
)
263265
PROUPSERT007d = _Reference(
264266
"WARN",
265-
"Upsert - RelatesTo validation failed - relating pointer NHS number mismatch",
267+
"RelatesTo validation failed - relating pointer NHS number mismatch for upsert",
266268
)
267269
PROUPSERT007e = _Reference(
268270
"WARN",
269-
"Upsert - RelatesTo validation failed - relating pointer document type mismatch",
270-
)
271-
PROUPSERT008 = _Reference(
272-
"INFO", "Upsert - Selecting document as target to be superseded"
271+
"RelatesTo validation failed - relating pointer document type mismatch for upsert",
273272
)
273+
PROUPSERT008 = _Reference("INFO", "Selecting document as target to be superseded")
274274
PROUPSERT009 = _Reference("INFO", "Upserting new document reference")
275-
PROUPSERT010 = _Reference("INFO", "Upsert - Superseding document reference")
275+
PROUPSERT010 = _Reference("INFO", "Superseding document reference for upsert")
276276
PROUPSERT011 = _Reference(
277-
"INFO", "Upsert - Preserved .date field when creating new document reference"
277+
"INFO", "Preserved .date field when creating new document reference for upsert"
278278
)
279279
PROUPSERT999 = _Reference(
280280
"INFO", "Successfully completed producer upsertDocumentReference"

0 commit comments

Comments
 (0)