Skip to content

Commit

Permalink
Check non-nil error (currently always nil) in diff-states
Browse files Browse the repository at this point in the history
This commit checks for error returned from a goroutine which
currently does not return any error.

This check is done as a precaution in case the goroutine is
modified in the future to return error.
  • Loading branch information
fxamacker committed Jun 17, 2024
1 parent a7a3c4b commit 27b9747
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cmd/util/ledger/migrations/cadence_value_diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,15 @@ func (dr *CadenceValueDiffReporter) diffDomain(
}()

// Wait for workers
_ = g.Wait()
err := g.Wait()
if err != nil {
dr.reportWriter.Write(
diffError{
Address: dr.address.Hex(),
Kind: diffErrorKindString[abortErrorKind],
Msg: fmt.Sprintf("failed to diff domain %s: %s", domain, err),
})
}

log.Info().
Msgf(
Expand Down

0 comments on commit 27b9747

Please sign in to comment.