aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas <>2022-05-05 17:26:27 +0200
committerThomas <>2022-05-05 17:26:27 +0200
commitb3f78f57ff8da8a82af57377eaabea22031582e9 (patch)
tree822df7804f03d56e73639e1bd2daa7cbd3848fc8
parent363e8657cd060f9a585b8e1dbac88aa12457238f (diff)
downloadNational_eIDAS_Gateway-b3f78f57ff8da8a82af57377eaabea22031582e9.tar.gz
National_eIDAS_Gateway-b3f78f57ff8da8a82af57377eaabea22031582e9.tar.bz2
National_eIDAS_Gateway-b3f78f57ff8da8a82af57377eaabea22031582e9.zip
chore(szr): optimize error-logging in case of SZR errors
-rw-r--r--modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/szr/SzrClient.java20
1 files changed, 13 insertions, 7 deletions
diff --git a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/szr/SzrClient.java b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/szr/SzrClient.java
index 11ea2843..11b1e589 100644
--- a/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/szr/SzrClient.java
+++ b/modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/szr/SzrClient.java
@@ -67,8 +67,6 @@ import org.apache.cxf.jaxws.DispatchImpl;
import org.apache.cxf.transport.http.HTTPConduit;
import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
import org.apache.xpath.XPathAPI;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.w3c.dom.Document;
@@ -87,6 +85,7 @@ import at.gv.egiz.eaaf.core.api.idp.IConfiguration;
import at.gv.egiz.eaaf.core.impl.utils.DomUtils;
import at.gv.egiz.eaaf.core.impl.utils.FileUtils;
import at.gv.egiz.eaaf.core.impl.utils.KeyStoreUtils;
+import lombok.extern.slf4j.Slf4j;
import szrservices.GetBPK;
import szrservices.GetBPKResponse;
import szrservices.GetIdentityLinkEidas;
@@ -102,9 +101,9 @@ import szrservices.SignContentEntry;
import szrservices.SignContentResponseType;
+@Slf4j
@Service("SZRClientForeIDAS")
public class SzrClient {
- private static final Logger log = LoggerFactory.getLogger(SzrClient.class);
private static final String CLIENT_DEFAULT = "DefaultClient";
private static final String CLIENT_RAW = "RawClient";
@@ -187,7 +186,8 @@ public class SzrClient {
return idl;
} catch (final Exception e) {
- log.warn("SZR communication FAILED. Reason: " + e.getMessage(), e);
+ log.warn("SZR communication FAILED for operation: {} Reason: {}",
+ "GetIdentityLinkEidas", e.getMessage(), e);
throw new SzrCommunicationException("ernb.02", new Object[]{e.getMessage()}, e);
}
@@ -215,7 +215,8 @@ public class SzrClient {
return result.getGetBPKReturn();
} catch (final SZRException_Exception e) {
- log.warn("SZR communication FAILED. Reason: " + e.getMessage(), e);
+ log.warn("SZR communication FAILED for operation: {} Reason: {}",
+ "GetBPK", e.getMessage(), e);
throw new SzrCommunicationException("ernb.02", new Object[]{e.getMessage()}, e);
}
@@ -235,12 +236,16 @@ public class SzrClient {
final String resp;
try {
resp = this.szr.getStammzahlEncrypted(personInfo, insertErnp);
+
} catch (SZRException_Exception e) {
+ log.warn("SZR communication FAILED for operation: {} Reason: {}",
+ "getStammzahlEncrypted", e.getMessage(), e);
throw new SzrCommunicationException("ernb.02", new Object[]{e.getMessage()}, e);
}
- if (StringUtils.isEmpty(resp)) {
+ if (StringUtils.isEmpty(resp)) {
throw new SzrCommunicationException("ernb.01", new Object[]{"Stammzahl response empty"}); // TODO error handling
+
}
return resp;
@@ -305,7 +310,8 @@ public class SzrClient {
return resp.getOut().get(0).getValue();
} catch (final JsonProcessingException | SZRException_Exception e) {
- log.warn("Requesting bcBind by using SZR FAILED. Reason: {}", e.getMessage(), null, e);
+ log.warn("SZR communication FAILED for operation: {} Reason: {}",
+ "SignContent", e.getMessage(), e);
throw new SzrCommunicationException("ernb.02",
new Object[]{e.getMessage()}, e);
}