From 24c07d9bb173e3513ea8269652a2c76ea19107f7 Mon Sep 17 00:00:00 2001 From: ariannazafarana <112564573+ariannazafarana@users.noreply.github.com> Date: Mon, 27 Nov 2023 11:00:38 +0100 Subject: [PATCH] minor change in error messages --- .../pull/service/service/impl/ConsumerServiceImpl.java | 4 ++-- .../pull/service/service/impl/OrganizationServiceImpl.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/it/pagopa/interop/signalhub/pull/service/service/impl/ConsumerServiceImpl.java b/src/main/java/it/pagopa/interop/signalhub/pull/service/service/impl/ConsumerServiceImpl.java index 0fe73cd..4c57a15 100644 --- a/src/main/java/it/pagopa/interop/signalhub/pull/service/service/impl/ConsumerServiceImpl.java +++ b/src/main/java/it/pagopa/interop/signalhub/pull/service/service/impl/ConsumerServiceImpl.java @@ -32,7 +32,7 @@ public Mono getConsumerEservice(String eserviceId, String cons .doOnNext(cache -> log.info("[{}-{}] ConsumerEService in cache", consumerId, eserviceId)) .flatMap(eServiceCache -> { if(eServiceCache.getState().equalsIgnoreCase(Const.STATE_ACTIVE)) return Mono.just(eServiceCache); - return Mono.error(new PDNDGenericException(UNAUTHORIZED, UNAUTHORIZED.getMessage().concat(eserviceId), HttpStatus.FORBIDDEN)); + return Mono.error(new PDNDGenericException(UNAUTHORIZED, UNAUTHORIZED.getMessage().concat(" ").concat(eserviceId), HttpStatus.FORBIDDEN)); }) .switchIfEmpty(Mono.defer(() -> { log.info("[{}-{}] ConsumerEService no in cache", consumerId, eserviceId); @@ -47,7 +47,7 @@ private Mono getFromDbAndSaveOnCache(String eserviceId, String return this.consumerEServiceRepository.findByConsumerIdAndEServiceIdAndState(eserviceId,consumerId, Const.STATE_ACTIVE) .switchIfEmpty(Mono.defer(()-> { log.info("[{}-{}] ConsumerEService not founded into DB", consumerId, eserviceId); - return Mono.error(new PDNDGenericException(UNAUTHORIZED, UNAUTHORIZED.getMessage().concat(eserviceId), HttpStatus.FORBIDDEN)); + return Mono.error(new PDNDGenericException(UNAUTHORIZED, UNAUTHORIZED.getMessage().concat(" ").concat(eserviceId), HttpStatus.FORBIDDEN)); })) .doOnNext(entity -> log.info("[{}-{}] ConsumerEService founded into DB", consumerId, eserviceId) diff --git a/src/main/java/it/pagopa/interop/signalhub/pull/service/service/impl/OrganizationServiceImpl.java b/src/main/java/it/pagopa/interop/signalhub/pull/service/service/impl/OrganizationServiceImpl.java index d2fcfc5..6337135 100644 --- a/src/main/java/it/pagopa/interop/signalhub/pull/service/service/impl/OrganizationServiceImpl.java +++ b/src/main/java/it/pagopa/interop/signalhub/pull/service/service/impl/OrganizationServiceImpl.java @@ -37,7 +37,7 @@ public Mono getEService(String eserviceId, String descriptorId) { .doOnNext(cache -> log.info("[{}-{}] EService in cache", eserviceId, descriptorId)) .flatMap(eServiceCache -> { if(eServiceCache.getState().equalsIgnoreCase(Const.STATE_PUBLISHED)) return Mono.just(eServiceCache); - return Mono.error(new PDNDGenericException(UNAUTHORIZED, UNAUTHORIZED.getMessage().concat(eserviceId), HttpStatus.FORBIDDEN)); + return Mono.error(new PDNDGenericException(UNAUTHORIZED, UNAUTHORIZED.getMessage().concat(" ").concat(eserviceId), HttpStatus.FORBIDDEN)); }) .switchIfEmpty(Mono.defer(() -> { log.info("[{}-{}] EService no in cache", eserviceId, descriptorId); @@ -53,7 +53,7 @@ private Mono getFromDbAndSaveOnCache(String eserviceId, String descrip return this.eServiceRepository.checkEServiceStatus(eserviceId, descriptorId, Const.STATE_PUBLISHED) .switchIfEmpty(Mono.defer(()-> { log.info("[{}-{}] EService not founded into DB", eserviceId, descriptorId); - return Mono.error(new PDNDGenericException(UNAUTHORIZED, UNAUTHORIZED.getMessage().concat(eserviceId), HttpStatus.FORBIDDEN)); + return Mono.error(new PDNDGenericException(UNAUTHORIZED, UNAUTHORIZED.getMessage().concat(" ").concat(eserviceId), HttpStatus.FORBIDDEN)); })) .doOnNext(entity -> log.info("[{}-{}] EService founded into DB", eserviceId, descriptorId)