/** * Upon request failure an empty output event will be returned to the functions platform as part of * the WrappedOutput. */ @Override protected WrappedOutput onRequestFailure(Exception e, WrappedInput wrappedInput, @Nullable JRestlessContainerRequest jRestlessContainerRequest) { LOG.error("Request failed", e); OutputEvent outputEvent = OutputEvent.emptyResult(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()); return new WrappedOutput(outputEvent, null, Response.Status.INTERNAL_SERVER_ERROR); }
@Override public Optional<OutputEvent> wrapFunctionResult(InvocationContext ctx, MethodWrapper method, Object value) { if (method.getReturnType().getParameterClass().equals(Void.class)) { return Optional.of(OutputEvent.emptyResult(OutputEvent.Status.Success)); } else { return Optional.empty(); } } }