Skip to content

Commit

Permalink
DL-IdFix - Added id to error scenrio
Browse files Browse the repository at this point in the history
  • Loading branch information
scott-goodwin committed Feb 9, 2023
1 parent fab5a09 commit ce77ce8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/v1/controllers/SubmitReturnController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,16 @@ class SubmitReturnController @Inject()(val authService: EnrolmentsAuthService,

Created(Json.toJson(serviceResponse.responseData))
.withApiHeaders(serviceResponse.correlationId,
"Receipt-ID" -> nrsId,
"Receipt-ID" -> correlationId,
"Receipt-Timestamp" -> submissionTimestamp.format(DateUtils.isoInstantDatePattern),
"Receipt-Signature" -> NrsResponse.deprecatedString)
}

result.leftMap { errorWrapper =>
val resCorrelationId: String = errorWrapper.correlationId
val leftResult = errorResult(errorWrapper).withApiHeaders(resCorrelationId)
val leftResult = errorResult(errorWrapper).withApiHeaders(
resCorrelationId,
"Receipt-ID" -> correlationId)
warnLog(ControllerError(endpointLogContext ,vrn, request, leftResult.header.status, errorWrapper.error.message, resCorrelationId))

auditService.auditEvent(AuditEvents.auditSubmit(resCorrelationId,
Expand Down

0 comments on commit ce77ce8

Please sign in to comment.