Merge pull request #13345 from gudmojo/error-substring

Limit the length of errors that get written to the database
This commit is contained in:
Patrik Oldsberg
2022-08-31 23:40:36 +02:00
committed by GitHub
2 changed files with 9 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@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);