From cdcf596fdef9680eec4fc0e7d91f25f18527ceb6 Mon Sep 17 00:00:00 2001 From: Dede Hamzah Date: Thu, 7 Jul 2022 14:14:37 +0700 Subject: [PATCH] Update Wrong Error Code in Register Component DryRun The error code for input validation should not default to 500 Signed-off-by: Dede Hamzah --- plugins/catalog-backend/src/service/DefaultLocationService.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/catalog-backend/src/service/DefaultLocationService.ts b/plugins/catalog-backend/src/service/DefaultLocationService.ts index fc6ffb0825..e481f3d949 100644 --- a/plugins/catalog-backend/src/service/DefaultLocationService.ts +++ b/plugins/catalog-backend/src/service/DefaultLocationService.ts @@ -81,7 +81,7 @@ export class DefaultLocationService implements LocationService { stringifyEntityRef(processed.completedEntity), ) ) { - throw new Error( + throw new InputError( `Duplicate nested entity: ${stringifyEntityRef( processed.completedEntity, )}`, @@ -90,7 +90,7 @@ export class DefaultLocationService implements LocationService { unprocessedEntities.push(...processed.deferredEntities); entities.push(processed.completedEntity); } else { - throw Error(processed.errors.map(String).join(', ')); + throw new InputError(processed.errors.map(String).join(', ')); } } return entities;