http4k / org.http4k.filter / HandleRemoteRequestFailed
fun
ServerFilters
.HandleRemoteRequestFailed(exceptionToBody:
RemoteRequestFailed
.() ->
String
= Throwable::getLocalizedMessage):
Filter
Handle exceptions from remote calls and convert them into sensible server-side errors. Optionally pass in a function to format the response body from the exception.
fun
ClientFilters
.HandleRemoteRequestFailed(responseWasSuccessful:
Response
.() ->
Boolean
= { status.successful }, responseToMessage:
Response
.() ->
String
= Response::bodyString): <ERROR CLASS>
Convert errors from remote calls into exceptions which can be handled at a higher level. Optionally pass in: