removed obsolete errors

This commit is contained in:
Stephan D
2025-11-18 00:20:25 +01:00
parent ebb40c8e9b
commit 363e9afc0a
14 changed files with 82 additions and 57 deletions

View File

@@ -3,11 +3,11 @@ package client
import (
"context"
"crypto/tls"
"errors"
"fmt"
"strings"
"time"
"github.com/tech/sendico/pkg/merrors"
orchestratorv1 "github.com/tech/sendico/pkg/proto/payments/orchestrator/v1"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
@@ -48,7 +48,7 @@ type orchestratorClient struct {
func New(ctx context.Context, cfg Config, opts ...grpc.DialOption) (Client, error) {
cfg.setDefaults()
if strings.TrimSpace(cfg.Address) == "" {
return nil, errors.New("payment-orchestrator: address is required")
return nil, merrors.InvalidArgument("payment-orchestrator: address is required")
}
dialCtx, cancel := context.WithTimeout(ctx, cfg.DialTimeout)
@@ -65,7 +65,7 @@ func New(ctx context.Context, cfg Config, opts ...grpc.DialOption) (Client, erro
conn, err := grpc.DialContext(dialCtx, cfg.Address, dialOpts...)
if err != nil {
return nil, fmt.Errorf("payment-orchestrator: dial %s: %w", cfg.Address, err)
return nil, merrors.InternalWrap(err, fmt.Sprintf("payment-orchestrator: dial %s", cfg.Address))
}
return &orchestratorClient{