2025-11-01 13:36:07: merge [main:a42a15d6d6a2aed3e341bb7f2e283cde097dc334];
This commit is contained in:
1 parent
b7b9a303ba
commit
aff6aefec6
4 files changed
+10
-7
No files matched your search
+2
-2
@@ -16,9 +16,9 @@ for status in $statusResponse; do
|
||||
read -ra ADDR <<<"$status"
|
||||
for module_name in "${ADDR[0]}"; do
|
||||
if [ -n "$*" ]; then
|
||||
ispctl $* schema $module_name -o html > schemas/$module_name.html
|
||||
ispctl $* schema -o html $module_name > schemas/$module_name.html
|
||||
else
|
||||
ispctl schema $module_name -o html > schemas/$module_name.html
|
||||
ispctl schema -o html $module_name > schemas/$module_name.html
|
||||
fi
|
||||
break
|
||||
done
|
||||
|
||||
+3
-1
@@ -132,7 +132,9 @@ func (c Variables) readVariablesFromCsv(filepath string) ([]model.UpsertVariable
|
||||
if err != nil {
|
||||
return nil, errors.WithMessagef(err, "failed to open file %s", filepath)
|
||||
}
|
||||
defer file.Close()
|
||||
defer func() {
|
||||
_ = file.Close()
|
||||
}()
|
||||
|
||||
reader := csv.NewReader(file)
|
||||
reader.TrimLeadingSpace = true
|
||||
|
||||
@@ -69,7 +69,7 @@ func configServiceFromGlobalFlags(ctx *cli.Context) (service.Config, error) {
|
||||
enableUnsafe := ctx.Bool(command.UnsafeFlagName)
|
||||
|
||||
host := ctx.String(command.HostFlagName)
|
||||
host = strings.Replace(host, "'", "", -1)
|
||||
host = strings.ReplaceAll(host, "'", "")
|
||||
|
||||
configCli, err := repository.NewGrpcClientWithHost(host)
|
||||
if err != nil {
|
||||
|
||||
@@ -3,11 +3,12 @@ package repository
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
epb "google.golang.org/genproto/googleapis/rpc/errdetails"
|
||||
"ispctl/model"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
epb "google.golang.org/genproto/googleapis/rpc/errdetails"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/txix-open/isp-kit/grpc/apierrors"
|
||||
"github.com/txix-open/isp-kit/grpc/client"
|
||||
@@ -150,8 +151,8 @@ func (c Config) handleVariableError(err error, endpoint string) error {
|
||||
if apiError == nil {
|
||||
return errors.WithMessagef(err, "call %s", endpoint)
|
||||
}
|
||||
switch {
|
||||
case apiError.ErrorCode == model.ErrCodeVariableNotFound:
|
||||
switch apiError.ErrorCode {
|
||||
case model.ErrCodeVariableNotFound:
|
||||
return model.ErrVariableNotFound
|
||||
default:
|
||||
return errors.WithMessagef(err, "call %s", endpoint)
|
||||
|
||||
Reference in new issue
Block a user