Code review comment: > IOException may contian sensitive message. The old logic seems doesn't want to return it to client. Maybe it's reasonable?  got it. make sense

Code under review:
protected void handleQuery() {
        MetricRepo.COUNTER_REQUEST_ALL.increase(1L);
        ctx.getAuditEventBuilder().reset();
        ctx.getAuditEventBuilder()
                .setTimestamp(System.currentTimeMillis())
                .setClientIp(ctx.getRemoteIP())
                .setUser(ctx.getQualifiedUser())
                .setAuthorizedUser(
                        ctx.getCurrentUserIdentity() == null ? "null" : ctx.getCurrentUserIdentity().toString())
                .setDb(ctx.getDatabase())
                .setCatalog(ctx.getCurrentCatalog());
        Tracers.register(ctx);

        StatementBase parsedStmt = ((HttpConnectContext) ctx).getStatement();
        String sql = parsedStmt.getOrigStmt().originStmt;

        addRunningQueryDetail(parsedStmt);

        executor = new StmtExecutor(ctx, parsedStmt);
        ctx.setExecutor(executor);

        ctx.setIsLastStmt(true);

        
        if (executor.isForwardToLeader()) {
            LOG.warn("non-master FE can not read, forward HTTP request to master");
            ((HttpConnectContext) ctx).setForwardToLeader(true);
            return;
        }

        try {
            executor.execute();
        } catch (IOException e) {
            
            LOG.warn("Process one query failed because IOException: ", e);
            ctx.getState().setError("StarRocks process failed");
            ctx.getState().setErrType(QueryState.ErrType.IO_ERR);
        } catch (UserException e) {
            LOG.warn("Process one query failed. SQL: " + sql + ", because.", e);
            ctx.getState().setError(e.getMessage());
            
            ctx.getState().setErrType(QueryState.ErrType.ANALYSIS_ERR);
        } catch (Throwable e) {
            
            
            LOG.warn("Process one query failed. SQL: " + sql + ", because unknown reason: ", e);
            ctx.getState().setError("Unexpected exception: " + e.getMessage());
            if (parsedStmt instanceof KillStmt) {
                
                ctx.getState().setErrType(QueryState.ErrType.IGNORE_ERR);
            } else {
                ctx.getState().setErrType(QueryState.ErrType.INTERNAL_ERR);
            }
        } finally {
            Tracers.close();
        }

        
        
        
        
        if (executor != null) {
            auditAfterExec(sql, executor.getParsedStmt(), executor.getQueryStatisticsForAuditLog());
        } else {
            
            auditAfterExec(sql, null, null);
        }

        addFinishedQueryDetail();
    }

Line commented on: ctx.getState().setError("StarRocks process failed");

Revised code:
protected void handleQuery() {
        MetricRepo.COUNTER_REQUEST_ALL.increase(1L);
        ctx.getAuditEventBuilder().reset();
        ctx.getAuditEventBuilder()
                .setTimestamp(System.currentTimeMillis())
                .setClientIp(ctx.getRemoteIP())
                .setUser(ctx.getQualifiedUser())
                .setAuthorizedUser(
                        ctx.getCurrentUserIdentity() == null ? "null" : ctx.getCurrentUserIdentity().toString())
                .setDb(ctx.getDatabase())
                .setCatalog(ctx.getCurrentCatalog());
        Tracers.register(ctx);

        StatementBase parsedStmt = ((HttpConnectContext) ctx).getStatement();
        String sql = parsedStmt.getOrigStmt().originStmt;

        addRunningQueryDetail(parsedStmt);

        executor = new StmtExecutor(ctx, parsedStmt);
        ctx.setExecutor(executor);

        ctx.setIsLastStmt(true);

        
        if (executor.isForwardToLeader()) {
            LOG.warn("non-master FE can not read, forward HTTP request to master");
            ((HttpConnectContext) ctx).setForwardToLeader(true);
            return;
        }

        try {
            executor.execute();
        } catch (IOException e) {
            
            LOG.warn("Process one query failed because IOException: ", e);
            ctx.getState().setError("StarRocks process failed");
            ctx.getState().setErrType(QueryState.ErrType.IO_ERR);
        } catch (UserException e) {
            LOG.warn("Process one query failed. SQL: " + sql + ", because.", e);
            ctx.getState().setError(e.getMessage());
            
            ctx.getState().setErrType(QueryState.ErrType.ANALYSIS_ERR);
        } catch (Throwable e) {
            
            
            LOG.warn("Process one query failed. SQL: " + sql + ", because unknown reason: ", e);
            ctx.getState().setError("Unexpected exception: " + e.getMessage());
            if (parsedStmt instanceof KillStmt) {
                
                ctx.getState().setErrType(QueryState.ErrType.IGNORE_ERR);
            } else {
                ctx.getState().setErrType(QueryState.ErrType.INTERNAL_ERR);
            }
        } finally {
            Tracers.close();
        }

        
        
        
        
        if (executor != null) {
            auditAfterExec(sql, executor.getParsedStmt(), executor.getQueryStatisticsForAuditLog());
        } else {
            
            auditAfterExec(sql, null, null);
        }

        addFinishedQueryDetail();
    }