Skip to content

Commit

Permalink
fix: comments
Browse files Browse the repository at this point in the history
  • Loading branch information
littleniannian committed Oct 25, 2024
1 parent 230c55e commit 5710d6c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion sqle/server/auditplan/task_type_mysql_processlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package auditplan
import (
"context"
"fmt"
"github.com/actiontech/sqle/sqle/errors"
"strconv"
"time"

Expand Down Expand Up @@ -82,7 +83,7 @@ func (at *MySQLProcessListTaskV2) ExtractSQL(logger *logrus.Entry, ap *AuditPlan
return nil, fmt.Errorf("get instance fail, error: %v", err)
}
if !exist {
return nil, fmt.Errorf("instance: %v is not exist", ap.InstanceID)
return nil, errors.NewInstanceNoExistErr()
}

db, err := executor.NewExecutor(logger, &driverV2.DSN{
Expand Down
3 changes: 2 additions & 1 deletion sqle/server/auditplan/task_type_mysql_schema_meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"encoding/json"
"fmt"
"github.com/actiontech/sqle/sqle/errors"
"strconv"
"time"

Expand Down Expand Up @@ -52,7 +53,7 @@ func (at *BaseSchemaMetaTaskV2) extractSQL(logger *logrus.Entry, ap *AuditPlan,
return nil, fmt.Errorf("get instance fail, error: %v", err)
}
if !exist {
return nil, fmt.Errorf("instance: %v is not exist", ap.InstanceID)
return nil, errors.NewInstanceNoExistErr()
}
db, err := executor.NewExecutor(logger, &driverV2.DSN{
Host: instance.Host,
Expand Down
3 changes: 2 additions & 1 deletion sqle/server/auditplan/task_type_oracle_topsql.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package auditplan
import (
"context"
"fmt"
"github.com/actiontech/sqle/sqle/errors"
"strconv"
"time"

Expand Down Expand Up @@ -100,7 +101,7 @@ func (at *OracleTopSQLTaskV2) ExtractSQL(logger *logrus.Entry, ap *AuditPlan, pe
return nil, fmt.Errorf("get instance fail, error: %v", err)
}
if !exist {
return nil, fmt.Errorf("instance: %v is not exist", ap.InstanceID)
return nil, errors.NewInstanceNoExistErr()
}
// This depends on: https://github.com/actiontech/sqle-oracle-plugin.
// If your Oracle db plugin does not implement the parameter `service_name`,
Expand Down
3 changes: 2 additions & 1 deletion sqle/server/pipeline/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package pipeline
import (
"context"
"fmt"
"github.com/actiontech/sqle/sqle/errors"
"net"
"net/url"
"time"
Expand Down Expand Up @@ -46,7 +47,7 @@ func (node PipelineNode) IntegrationInfo(ctx context.Context, projectName string
return "", err
}
if !exist {
return "", fmt.Errorf("instance: %v is not exist", node.InstanceID)
return "", errors.NewInstanceNoExistErr()
}
node.InstanceName = instance.Name
}
Expand Down

0 comments on commit 5710d6c

Please sign in to comment.