class RpcExceptionMapper implements ExceptionMapper<Exception> {

    @Override
    public Response toResponse(Exception exception) {<FILL_FUNCTION_BODY>}

}

        HttpRequest httpRequest = ResteasyProviderFactory.getContextData(HttpRequest.class);
        // 当为rpc调用时,序列化异常
        if (httpRequest != null && RestfulUtil.isRpcRequest(httpRequest.getMutableHeaders())) {
            return RestfulUtil.serializeError(exception);
        }

        return Response.status(Status.INTERNAL_SERVER_ERROR).entity(exception.getMessage()).build();
    
<no_super_class>