diff --git a/plugin-server/src/worker/ingestion/event-pipeline/processPersonsStep.ts b/plugin-server/src/worker/ingestion/event-pipeline/processPersonsStep.ts index 529cedfb0c213..0ae5390cc2d93 100644 --- a/plugin-server/src/worker/ingestion/event-pipeline/processPersonsStep.ts +++ b/plugin-server/src/worker/ingestion/event-pipeline/processPersonsStep.ts @@ -1,7 +1,9 @@ import { PluginEvent } from '@posthog/plugin-scaffold' +import { DateTime } from 'luxon' import { Person } from 'types' import { normalizeEvent } from '../../../utils/event' +import { status } from '../../../utils/status' import { PersonState } from '../person-state' import { parseEventTimestamp } from '../timestamps' import { EventPipelineRunner } from './runner' @@ -10,9 +12,15 @@ export async function processPersonsStep( runner: EventPipelineRunner, pluginEvent: PluginEvent ): Promise<[PluginEvent, Person]> { - const event = normalizeEvent(pluginEvent) - - const timestamp = parseEventTimestamp(event) + let event: PluginEvent + let timestamp: DateTime + try { + event = normalizeEvent(pluginEvent) + timestamp = parseEventTimestamp(event) + } catch (error) { + status.warn('⚠️', 'Failed normalizing event', { team_id: pluginEvent.team_id, uuid: pluginEvent.uuid, error }) + throw error + } const person = await new PersonState( event,