Skip to content

Commit 3321dda

Browse files
committed
Chore: err handling
1 parent ad2d5cf commit 3321dda

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cmd/bot/main.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,21 +126,21 @@ func main() {
126126
return fmt.Errorf("failed to start service: %v", err)
127127
}
128128

129+
var runErr error
130+
129131
for {
130132
slog.DebugContext(ctx, "checking...")
131133
if err := content.Do(ctx, c); err != nil {
132134
if !errors.Is(err, content.ErrCouldNotContent) {
133-
slog.ErrorContext(ctx, err.Error())
134-
os.Exit(1)
135+
runErr = err
136+
break
135137
}
136138
slog.DebugContext(ctx, "backing off...")
137-
break
138-
139139
}
140140

141141
time.Sleep(checkInterval)
142142
}
143-
return nil
143+
return runErr
144144
},
145145
}
146146

0 commit comments

Comments
 (0)