Skip to content

Commit

Permalink
API-1888 - Add trace requests and debug log when DES does not have data
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas VANDEVELDE committed Sep 12, 2016
1 parent 06c8d80 commit 351628d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package uk.gov.hmrc.openidconnect.userinfo.connectors

import play.api.Logger
import uk.gov.hmrc.openidconnect.userinfo.config.{WSHttp, AppContext}
import uk.gov.hmrc.openidconnect.userinfo.domain.DesUserInfo
import uk.gov.hmrc.play.config.ServicesConfig
Expand All @@ -40,7 +41,9 @@ trait DesConnector {
"Environment" -> desEnvironment)

http.GET[DesUserInfo](s"$serviceUrl/pay-as-you-earn/individuals/${withoutSuffix(nino)}")(implicitly[HttpReads[DesUserInfo]], newHc) map (Some(_)) recover {
case _: NotFoundException | _: BadRequestException => None
case _: NotFoundException | _: BadRequestException =>
Logger.debug(s"User information for nino $nino is not available in DES")
None
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package uk.gov.hmrc.openidconnect.userinfo.services

import play.api.Logger
import uk.gov.hmrc.openidconnect.userinfo.connectors.{AuthConnector, DesConnector}
import uk.gov.hmrc.openidconnect.userinfo.data.UserInfoGenerator
import uk.gov.hmrc.openidconnect.userinfo.domain._
Expand All @@ -42,7 +43,9 @@ trait LiveUserInfoService extends UserInfoService {
} yield userInfo

future map (Some(_)) recover {
case NinoNotFoundException() => None
case NinoNotFoundException() =>
Logger.debug("Nino not present in Bearer Token")
None
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion conf/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ Prod {

auditing {
enabled=true
traceRequests=false
traceRequests=true
consumer {
baseUri {
host = datastream.service
Expand Down

0 comments on commit 351628d

Please sign in to comment.