diff --git a/src/main/java/net/maritimeconnectivity/identityregistry/keycloak/spi/eventprovider/MCPEventListenerProvider.java b/src/main/java/net/maritimeconnectivity/identityregistry/keycloak/spi/eventprovider/MCPEventListenerProvider.java index 5a1ba56..9cdd97c 100644 --- a/src/main/java/net/maritimeconnectivity/identityregistry/keycloak/spi/eventprovider/MCPEventListenerProvider.java +++ b/src/main/java/net/maritimeconnectivity/identityregistry/keycloak/spi/eventprovider/MCPEventListenerProvider.java @@ -16,7 +16,6 @@ import com.fasterxml.jackson.core.type.TypeReference; import lombok.extern.jbosslog.JBossLog; -import net.maritimeconnectivity.identityregistry.keycloak.spi.exceptions.McpException; import net.maritimeconnectivity.pki.PKIIdentity; import org.apache.http.HttpEntity; import org.apache.http.client.methods.CloseableHttpResponse; @@ -375,7 +374,7 @@ protected String getContent(HttpEntity entity) { entity.writeTo(os); } catch (IOException e) { log.error("Could not get content", e); - throw new McpException(e); + return ""; } return os.toString(); } @@ -396,7 +395,7 @@ protected CloseableHttpClient buildHttpClient() { } } catch (NoSuchAlgorithmException | CertificateException | IOException | KeyStoreException e) { log.error("Could not load keystore or truststore", e); - throw new McpException(e); + return null; } finally { try { if (instreamTruststore != null) { @@ -419,7 +418,7 @@ protected CloseableHttpClient buildHttpClient() { sslcontext = sslContextBuilder.build(); } catch (KeyManagementException | UnrecoverableKeyException | NoSuchAlgorithmException | KeyStoreException e) { log.error("Could not build ssl context", e); - throw new McpException(e); + return null; } SSLConnectionSocketFactory sslsf; if (trustStore != null) { diff --git a/src/main/java/net/maritimeconnectivity/identityregistry/keycloak/spi/exceptions/McpException.java b/src/main/java/net/maritimeconnectivity/identityregistry/keycloak/spi/exceptions/McpException.java deleted file mode 100644 index def3d96..0000000 --- a/src/main/java/net/maritimeconnectivity/identityregistry/keycloak/spi/exceptions/McpException.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2017 Danish Maritime Authority. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package net.maritimeconnectivity.identityregistry.keycloak.spi.exceptions; - -public class McpException extends RuntimeException{ - - public McpException(Exception e) { - super(e); - } -}