diff --git a/app/connectors/IntegrationFrameworkConnector.scala b/app/connectors/IntegrationFrameworkConnector.scala index 4fe1a37..2c06ce8 100644 --- a/app/connectors/IntegrationFrameworkConnector.scala +++ b/app/connectors/IntegrationFrameworkConnector.scala @@ -62,7 +62,17 @@ class IntegrationFrameworkConnector @Inject() (http: HttpClientV2, appConfig: Ap .setHeader("Environment" -> appConfig.ifEnvironment) .setHeader(HeaderNames.authorisation -> s"Bearer ${appConfig.authorisationTokenFor(apiVersion)}") .execute[GetPeriodicSubmissionIdResponse] - .map(response => response.result) + .map { response => + if (response.result.isLeft) { + val correlationId = + response.httpResponse.header(key = "CorrelationId").map(id => s" CorrelationId: $id").getOrElse("") + logger.error( + s"Error getting periodic submission ids from the Integration Framework: URL: $url" + + s" correlationId: $correlationId; status: ${response.httpResponse.status}; Body:${response.httpResponse.body}" + ) + } + response.result + } }