From 73360f680551f33867e9d01a3224142d30cedd10 Mon Sep 17 00:00:00 2001 From: Keith Solomon Date: Mon, 3 Aug 2026 14:17:27 -0500 Subject: [PATCH] processLogEntries: skip incomplete entries instead of throwing Per the spec's error-handling table, entries missing timestamp or details.title should be skipped (logged via consoleLog) and the loop should continue processing the rest. Previously the function threw LogEntryIncompleteException and aborted the entire batch, which would take down the whole UI when a single malformed entry was returned. --- includes/utilities.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/includes/utilities.php b/includes/utilities.php index 52cca2b..5978072 100644 --- a/includes/utilities.php +++ b/includes/utilities.php @@ -117,9 +117,6 @@ function validateApiResponse($responseData) { * @param PDOStatement $insertStmt A prepared statement for the idempotent * insert (`INSERT … ON CONFLICT(id) DO NOTHING`) * - * @throws LogEntryIncompleteException If a vault entry is missing timestamp - * or details.title - * * @return void */ function processLogEntries($logEntries, $user, $insertStmt) { @@ -146,9 +143,8 @@ function processLogEntries($logEntries, $user, $insertStmt) { } if ($timestamp === null || $description === null) { - throw new LogEntryIncompleteException( - "Entry $id missing timestamp or details.title." - ); + consoleLog('Skipping entry ' . $id . ' missing timestamp or details.title: ' . print_r($entry, true)); + continue; } $insertStmt->bindValue(':id', $id);