diff --git a/src/main/scala/it/pagopa/interop/catalogprocess/api/impl/ResponseHandlers.scala b/src/main/scala/it/pagopa/interop/catalogprocess/api/impl/ResponseHandlers.scala index 1cad3126..04d2dca8 100644 --- a/src/main/scala/it/pagopa/interop/catalogprocess/api/impl/ResponseHandlers.scala +++ b/src/main/scala/it/pagopa/interop/catalogprocess/api/impl/ResponseHandlers.scala @@ -189,6 +189,7 @@ object ResponseHandlers extends AkkaResponses { case Failure(ex: EServiceDescriptorWithoutInterface) => badRequest(ex, logMessage) case Failure(ex: EServiceRiskAnalysisIsRequired) => badRequest(ex, logMessage) case Failure(ex: RiskAnalysisNotValid.type) => badRequest(ex, logMessage) + case Failure(ex: NotValidDescriptor) => badRequest(ex, logMessage) case Failure(ex) => internalServerError(ex, logMessage) } diff --git a/src/test/scala/it/pagopa/interop/catalogprocess/CatalogProcessSpec.scala b/src/test/scala/it/pagopa/interop/catalogprocess/CatalogProcessSpec.scala index 8b9bed4c..3d83eefc 100644 --- a/src/test/scala/it/pagopa/interop/catalogprocess/CatalogProcessSpec.scala +++ b/src/test/scala/it/pagopa/interop/catalogprocess/CatalogProcessSpec.scala @@ -1454,7 +1454,7 @@ class CatalogProcessSpec extends SpecHelper with AnyWordSpecLike with ScalatestR SpecData.catalogItem.id.toString, SpecData.catalogDescriptor.id.toString ) ~> check { - status shouldEqual StatusCodes.InternalServerError + status shouldEqual StatusCodes.BadRequest } } "fail if EService does not exist" in {