4f0a68bd7c
Signed-off-by: Brian Fletcher <brian@roadie.io>
879 B
879 B
@backstage/plugin-catalog-backend
| @backstage/plugin-catalog-backend |
|---|
| patch |
Make entity collection errors a little quieter in the logs.
Instead of logging a warning line when an entity has an error during processing, it will now instead emit an event on the event broker.
This only removes a single log line, however it is possible to
add the log line back if it is required by subscribing to the
CATALOG_ERRORS_TOPIC as shown below.
env.eventBroker.subscribe({
supportsEventTopics(): string[] {
return [CATALOG_ERRORS_TOPIC];
},
async onEvent(
params: EventParams<{
entity: string;
location?: string;
errors: Array<Error>;
}>,
): Promise<void> {
const { entity, location, errors } = params.eventPayload;
for (const error of errors) {
env.logger.warn(error.message, {
entity,
location,
});
}
},
});