Merge pull request #30421 from mhaley37/fix-missing-annotation-logging-message

Fix (techdocs-node): Fix `parseReferenceAnnotation` missing annotation error message to include annotation name
This commit is contained in:
Ben Lambert
2025-07-08 15:30:28 +02:00
committed by GitHub
3 changed files with 10 additions and 2 deletions
+4 -1
View File
@@ -113,9 +113,12 @@ describe('parseReferenceAnnotation', () => {
});
it('should throw error without annotation', () => {
const logMsgRegex = new RegExp(
`No ${TECHDOCS_ANNOTATION} annotation provided`,
);
expect(() => {
parseReferenceAnnotation(TECHDOCS_ANNOTATION, entityBase);
}).toThrow(/No location annotation/);
}).toThrow(logMsgRegex);
});
it('should throw error with bad annotation', () => {
+1 -1
View File
@@ -52,7 +52,7 @@ export const parseReferenceAnnotation = (
const annotation = entity.metadata.annotations?.[annotationName];
if (!annotation) {
throw new InputError(
`No location annotation provided in entity: ${entity.metadata.name}`,
`No ${annotationName} annotation provided in entity: ${entity.metadata.name}`,
);
}