From 5d46366bfebd7bc38d7df3d648bf03bd29700a2e Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Fri, 15 Jun 2018 13:16:19 +0200 Subject: fix first refactoring problems --- .../gv/egovernment/moa/id/commons/utils/MOAIDMessageProvider.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'id/server/moa-id-commons/src/main') diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/MOAIDMessageProvider.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/MOAIDMessageProvider.java index bc1e2dcdb..2cb867cbc 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/MOAIDMessageProvider.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/MOAIDMessageProvider.java @@ -48,6 +48,8 @@ package at.gv.egovernment.moa.id.commons.utils; import java.util.Locale; +import org.springframework.stereotype.Service; + import at.gv.egiz.eaaf.core.api.IStatusMessager; import at.gv.egiz.eaaf.core.exceptions.ProcessExecutionException; import at.gv.egovernment.moa.id.commons.api.exceptions.BKUException; @@ -57,7 +59,7 @@ import at.gv.egovernment.moa.util.Messages; import at.gv.egovernment.moa.util.MiscUtil; -//@Service("MOAIDMessageProvider") +@Service("MOAIDMessageProvider") public class MOAIDMessageProvider implements IStatusMessager { //internal messanges @@ -81,7 +83,7 @@ public class MOAIDMessageProvider implements IStatusMessager { } - private MOAIDMessageProvider() { + public MOAIDMessageProvider() { this.messages = new Messages(DEFAULT_MESSAGE_RESOURCES, DEFAULT_MESSAGE_LOCALES); this.externalError = new Messages(DEFAULT_EXTERNALERROR_RESOURCES, DEFAULT_EXTERNALERROR_LOCALES); @@ -136,7 +138,7 @@ public String getResponseErrorCode(Throwable throwable) { @Override public String mapInternalErrorToExternalError(String intErrorCode) { - String extErrorCode = messages.getMessage(intErrorCode, null); + String extErrorCode = externalError.getMessage(intErrorCode, null); if (MiscUtil.isEmpty(extErrorCode)) extErrorCode = IStatusMessager.CODES_EXTERNAL_ERROR_GENERIC; -- cgit v1.2.3