private static void handleRpcException(RpcException e, RetryContext context) {
        // When enable_collect_query_detail_info is set to true, the plan will be recorded in the query detail,
        // and hence there is no need to log it here.
        ConnectContext connectContext = context.connectContext;
        if (context.retryTime == 0 && connectContext.getQueryDetail() == null &&
                Config.log_plan_cancelled_by_crash_be) {
            LOG.warn(
                    "Query cancelled by crash of backends or RpcException, [QueryId={}] [SQL={}] [Plan={}]",
                    DebugUtil.printId(connectContext.getExecutionId()),
                    context.parsedStmt.getOrigStmt() == null ? "" : context.parsedStmt.getOrigStmt().originStmt,
                    context.execPlan == null ? "" : context.execPlan.getExplainString(TExplainLevel.COSTS),
                    e);
        }
    }
@Test
    public void testHandleRpcException() throws Exception {
        String sql = "select * from t0";
        StatementBase statementBase = SqlParser.parse(sql, connectContext.getSessionVariable()).get(0);
        ExecPlan execPlan = getExecPlan(sql);
        ExecuteExceptionHandler.RetryContext retryContext =
                new ExecuteExceptionHandler.RetryContext(0, execPlan, connectContext, statementBase);
        try {
            ExecuteExceptionHandler.handle(new RpcException("mock"), retryContext);
        } catch (Exception e) {
            fail("should not throw any exception");
        }
    }