Limit the length of errors that get written to the database

Signed-off-by: Gudmundur Orn Johannsson <gudmundur.orn@gmail.com>
This commit is contained in:
Gudmundur Orn Johannsson
2022-08-29 20:18:30 +03:00
parent 2c246ecebb
commit 06e2b077a1
2 changed files with 10 additions and 1 deletions
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/errors': patch
'@backstage/plugin-catalog-backend': patch
---
Limit the length of error messages that get written to the database and logs - to prevent performance issues
@@ -97,7 +97,10 @@ export class UrlReaderProcessor implements CatalogProcessor {
emit(processingResult.refresh(`${location.type}:${location.target}`));
} catch (error) {
assertError(error);
const message = `Unable to read ${location.type}, ${error}`;
const message = `Unable to read ${location.type}, ${error}`.substring(
0,
5000,
);
if (error.name === 'NotModifiedError' && cacheItem) {
for (const parseResult of cacheItem.value) {
emit(parseResult);