Skip to content

Commit

Permalink
API-1888 - Add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas VANDEVELDE committed Sep 13, 2016
1 parent 351628d commit 02c3b72
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ trait DesConnector {
"Authorization" -> ("Bearer " + desBearerToken),
"Environment" -> desEnvironment)

http.GET[DesUserInfo](s"$serviceUrl/pay-as-you-earn/individuals/${withoutSuffix(nino)}")(implicitly[HttpReads[DesUserInfo]], newHc) map (Some(_)) recover {
val url = s"$serviceUrl/pay-as-you-earn/individuals/${withoutSuffix(nino)}"
Logger.debug(s"GET $url with environment=$desEnvironment")

http.GET[DesUserInfo](url)(implicitly[HttpReads[DesUserInfo]], newHc) map (Some(_)) recover {
case _: NotFoundException | _: BadRequestException =>
Logger.debug(s"User information for nino $nino is not available in DES")
None
Expand Down

0 comments on commit 02c3b72

Please sign in to comment.