Hi, I am trying to use a custom HTTP handler with play framework in Java by following the documentation Java Error Handling - 2.8.x. I know if I throw a runtime exception, by default the onServerError method will be called in the custom HTTP Handler. Can anyone tell me, how the onClientError method in the HTTP Handler will be trigger?
I know that the onClientError will be invoked when a client error (or error in 4xx series will occur) but how exactly do I throw the client error from inside a controller.
P.S. I am using the play framework(Java) as a gateway server due to which I need to rethrow the exception thrown by the internal servers.