Skip to content

Commit

Permalink
TAV-302: Fixed json de-serialization error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
ssaleem-ee committed Jun 30, 2021
1 parent 4f6c0b4 commit 6820a30
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/util/AddressLookupJsonErrorHandler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class AddressLookupJsonErrorHandler @Inject()(auditConnector: AuditConnector,
override def onClientError(request: RequestHeader, statusCode: Int, message: String): Future[Result] = {
(statusCode, message) match {
case (BAD_REQUEST, msg) if msg.startsWith("Json validation error") =>
Future.successful(BadRequest("error=missing or badly-formed postcode parameter"))
Future.successful(BadRequest(s"""{"statusCode": $BAD_REQUEST, "message": "missing or badly-formed postcode parameter"}"""))
case _ => super.onClientError(request, statusCode, message)
}
}
Expand Down

0 comments on commit 6820a30

Please sign in to comment.