diff --git a/plugins/incremental-ingestion-backend/src/engine/IncrementalIngestionEngine.ts b/plugins/incremental-ingestion-backend/src/engine/IncrementalIngestionEngine.ts index 790e252dbf..4b8588cdfe 100644 --- a/plugins/incremental-ingestion-backend/src/engine/IncrementalIngestionEngine.ts +++ b/plugins/incremental-ingestion-backend/src/engine/IncrementalIngestionEngine.ts @@ -118,7 +118,10 @@ export class IncrementalIngestionEngine implements IterationEngine { const backoffLength = currentBackoff.as('milliseconds'); this.options.logger.error(error); - const truncatedError = (error as string).substring(0, 700); + const truncatedError = + typeof error === 'string' + ? error.substring(0, 700) + : `${error}`; this.options.logger.error( `incremental-engine: Ingestion '${ingestionId}' threw an error during ingestion burst. Ingestion will backoff for ${currentBackoff.toHuman()} (${truncatedError})`, );