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 } }