Add errcheck

Add errcheck
This commit is contained in:
Phi 2023-05-05 14:59:25 +02:00
parent 93618c0687
commit 075d068ccd

View File

@ -1932,7 +1932,10 @@ var sectorsBatchingPendingCommit = &cli.Command{
userInput = strings.ToLower(strings.TrimSpace(userInput))
if userInput == "yes" {
cctx.Set("publish-now", "true")
err := cctx.Set("publish-now", "true")
if err != nil {
return xerrors.Errorf("setting publish-now flag: %w", err)
}
return cctx.Command.Action(cctx)
} else if userInput == "no" {
return nil
@ -1940,7 +1943,6 @@ var sectorsBatchingPendingCommit = &cli.Command{
fmt.Println("Invalid input. Please answer with 'yes' or 'no'.")
return nil
}
}
fmt.Println("No sectors queued to be committed")
return nil
@ -2007,7 +2009,10 @@ var sectorsBatchingPendingPreCommit = &cli.Command{
userInput = strings.ToLower(strings.TrimSpace(userInput))
if userInput == "yes" {
cctx.Set("publish-now", "true")
err := cctx.Set("publish-now", "true")
if err != nil {
return xerrors.Errorf("setting publish-now flag: %w", err)
}
return cctx.Command.Action(cctx)
} else if userInput == "no" {
return nil