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