Skip to content

Commit

Permalink
Prevent leaving the batch open when there's an error setting the chil…
Browse files Browse the repository at this point in the history
…d batch (#16)
  • Loading branch information
sebamarucci authored Mar 21, 2022
1 parent cc50bd6 commit dc71ea2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions batch/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,7 @@ func (b *BatchSubsystem) batchCommand(c *server.Connection, s *server.Server, cm
childBatch, err := b.batchManager.getBatch(childBatchId)
if err != nil {
_ = c.Error(cmd, fmt.Errorf("cannot get child batch: %v", err))
return
}
if err := b.batchManager.addChild(batch, childBatch); err != nil {
} else if err := b.batchManager.addChild(batch, childBatch); err != nil {
_ = c.Error(cmd, fmt.Errorf("cannot add child (%s) to batch (%s): %v", childBatchId, batchId, err))
}
if opened {
Expand Down

0 comments on commit dc71ea2

Please sign in to comment.