From ed3961663797284c68ce50e0ad6e742023c7a861 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sat, 27 Dec 2025 23:36:36 +0000 Subject: [PATCH] fix(plugin-record-hook): rethrow errors instead of swallowing them Previously, errors during record hook execution were caught, logged, and then silently swallowed by returning early. This caused issues where record updates could fail silently without surfacing the error to the execution status. Changes: - Rethrow errors in the outer catch block so they propagate to the listener runtime and mark executions as failed - Preserve the original error message when catching errors from event.update() for better debugging Co-Authored-By: christopher.harrison@flatfile.io --- plugins/record-hook/src/RecordHook.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/record-hook/src/RecordHook.ts b/plugins/record-hook/src/RecordHook.ts index 16cd9f2cd..14c4ede1c 100644 --- a/plugins/record-hook/src/RecordHook.ts +++ b/plugins/record-hook/src/RecordHook.ts @@ -132,12 +132,13 @@ export const BulkRecordHook = async ( endTimer('update modified records', debug) return } catch (e) { - throw new Error('Error updating records') + const originalMessage = e instanceof Error ? e.message : String(e) + throw new Error(`Error updating records: ${originalMessage}`) } }) } catch (e) { logError('@flatfile/plugin-record-hook', (e as Error).message) await completeCommit(event, debug) - return + throw e } }