Skip to content

Commit 8e815d3

Browse files
committed
exit with error on repeat
1 parent 1cb4d0e commit 8e815d3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sync.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ func Sync(ctx context.Context, config Config) error {
7272
REPEAT_LOOP:
7373
for {
7474
err = syncOnce(ctx)
75+
if errors.Is(err, auth.ErrInvalidCredentials) {
76+
return ErrInvalidCredentials
77+
}
7578
if err != nil {
7679
if cfg.Repeat == 0 {
7780
return err
@@ -102,9 +105,6 @@ REPEAT_LOOP:
102105
func syncOnce(ctx context.Context) error {
103106
var err error
104107
token, client, err = auth.Authenticate(ctx, httpClient, defaultTimeout, cfg.Username, cfg.Password)
105-
if errors.Is(err, auth.ErrInvalidCredentials) {
106-
return ErrInvalidCredentials
107-
}
108108
if err != nil {
109109
return err
110110
}

0 commit comments

Comments
 (0)