Use stringifyerror
Signed-off-by: Damon Kaswell <damon.kaswell1@hp.com>
This commit is contained in:
committed by
Fredrik Adelöw
parent
35455be414
commit
87cabfed8c
@@ -33,6 +33,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/backend-common": "workspace:^",
|
||||
"@backstage/errors": "workspace:^",
|
||||
"@backstage/backend-plugin-api": "workspace:^",
|
||||
"@backstage/backend-tasks": "workspace:^",
|
||||
"@backstage/catalog-model": "workspace:^",
|
||||
|
||||
@@ -26,6 +26,7 @@ import type { AbortSignal } from 'node-abort-controller';
|
||||
import { performance } from 'perf_hooks';
|
||||
import { Duration, DurationObjectUnits } from 'luxon';
|
||||
import { v4 } from 'uuid';
|
||||
import { stringifyError } from '@backstage/errors';
|
||||
|
||||
export class IncrementalIngestionEngine implements IterationEngine {
|
||||
restLength: Duration;
|
||||
@@ -118,10 +119,7 @@ export class IncrementalIngestionEngine implements IterationEngine {
|
||||
const backoffLength = currentBackoff.as('milliseconds');
|
||||
this.options.logger.error(error);
|
||||
|
||||
const truncatedError =
|
||||
typeof error === 'string'
|
||||
? error.substring(0, 700)
|
||||
: `${error}`;
|
||||
const truncatedError = stringifyError(error).substring(0, 700);
|
||||
this.options.logger.error(
|
||||
`incremental-engine: Ingestion '${ingestionId}' threw an error during ingestion burst. Ingestion will backoff for ${currentBackoff.toHuman()} (${truncatedError})`,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user