Skip to content

Commit

Permalink
Propagate the error from aggregator.Start
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan-Ethernal committed Sep 13, 2024
1 parent 1298132 commit 551a495
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions aggregator/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ func (a *Aggregator) Start() error {

err = a.streamClient.Start()
if err != nil {
log.Fatalf("failed to start stream client, error: %v", err)
return fmt.Errorf("failed to start stream client, error: %w", err)
}

bookMark := &datastream.BookMark{
Expand All @@ -749,12 +749,12 @@ func (a *Aggregator) Start() error {

marshalledBookMark, err := proto.Marshal(bookMark)
if err != nil {
log.Fatalf("failed to marshal bookmark: %v", err)
return fmt.Errorf("failed to marshal bookmark: %w", err)
}

err = a.streamClient.ExecCommandStartBookmark(marshalledBookMark)
if err != nil {
log.Fatalf("failed to connect to data stream: %v", err)
return fmt.Errorf("failed to connect to data stream: %w", err)
}

// A this point everything is ready, so start serving
Expand Down
1 change: 1 addition & 0 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ func start(cliCtx *cli.Context) error {
// start aggregator in a goroutine, checking for errors
go func() {
if err := aggregator.Start(); err != nil {
aggregator.Stop()
log.Fatal(err)
}
}()
Expand Down

0 comments on commit 551a495

Please sign in to comment.