Я использую реактор-нетто, выполняю один код запроса поста, это
(req, resp) -> resp.addHeader(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.APPLICATION_JSON)
.status(HttpResponseStatus.OK)
.sendString(req
.receive()
.map(byteBuf -> {
CommonResponse<Object> response;
try {
response = (CommonResponse<Object>) method.invoke(handleObject, getMethodParams(method, req, resp, byteBuf));
} catch (Exception e) {
response = exceptionPublisher(e);
// in here i need get the code to change response status
int errorCode = response.getErr_code();
...?
}
return response;
})
.map(gsonCreate::toJson)
);
, но метод execute может вызывать пользовательское исключение, и мне нужно это исключение s error code to chanage the response status , now I can
t сделать это, Как это сделать?спасибо