Skip to content

Commit

Permalink
Update error logging for SOAP faults in OppdragWSConsumer #deploy-opp…
Browse files Browse the repository at this point in the history
…drag-service

Removed handling of `SendInnOppdragFeilUnderBehandling` exception and enhanced logging details for `SoapFaultClientException`. This change ensures more comprehensive error information is captured when SOAP faults occur.
  • Loading branch information
krharum committed Nov 7, 2024
1 parent 07bc5ff commit 8c6b7e5
Showing 1 changed file with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import no.nav.testnav.oppdragservice.config.ServerProperties;
import no.nav.testnav.oppdragservice.wsdl.SendInnOppdragFeilUnderBehandling;
import no.nav.testnav.oppdragservice.wsdl.SendInnOppdragRequest;
import no.nav.testnav.oppdragservice.wsdl.SendInnOppdragResponse;
import org.springframework.ws.client.core.support.WebServiceGatewaySupport;
Expand All @@ -28,20 +27,14 @@ public SendInnOppdragResponse sendOppdrag(String miljoe, SendInnOppdragRequest m

} catch (Exception e) {

if (e instanceof SendInnOppdragFeilUnderBehandling sendInnOppdragFeilUnderBehandling) {
if (e instanceof SoapFaultClientException soapFaultClientException) {

log.error("SendInnOppdragFeilUnderBehandling message: {}, rootCause: {}, errorSource; {}",
sendInnOppdragFeilUnderBehandling.getMessage(),
sendInnOppdragFeilUnderBehandling.getFaultInfo().getRootCause(),
sendInnOppdragFeilUnderBehandling.getFaultInfo().getErrorSource(), e);

} else if (e instanceof SoapFaultClientException soapFaultClientException){

log.error("SoapFaultClientException message: {}, faultCode: {}, soapfault: {}, faultStringOrReason: {}",
log.error("SoapFaultClientException message: {}, faultCode: {}, faultDetail: {}, faultActorOrRole: {}, faultStringOrReason: {}",
soapFaultClientException.getMessage(),
soapFaultClientException.getFaultCode(),
soapFaultClientException.getSoapFault(),
soapFaultClientException.getFaultStringOrReason(), e);
soapFaultClientException.getSoapFault().getFaultCode(),
soapFaultClientException.getSoapFault().getFaultDetail(),
soapFaultClientException.getSoapFault().getFaultActorOrRole(),
soapFaultClientException.getSoapFault().getFaultStringOrReason(), e);
}

throw e;
Expand Down

0 comments on commit 8c6b7e5

Please sign in to comment.