stop progress before return err
@@ -75,10 +75,12 @@ func (e *Blocks) GetBlock(
}
if err != nil {
+ e.logger.StopProgress()
return nil, nil, nil, fmt.Errorf("error fetching block: %s", err.Error())
}
if block == nil {
+ e.logger.StopProgress()
return nil, nil, nil, fmt.Errorf("block not found")
}
@@ -87,6 +89,7 @@ func (e *Blocks) GetBlock(
if eventType != "" {
events, err = e.gateway.GetEvents(eventType, block.Height, block.Height)
if err != nil {
+ e.logger.StopProgress()
return nil, nil, nil, err
}
}
@@ -97,6 +100,7 @@ func (e *Blocks) GetBlock(
for _, guarantee := range block.CollectionGuarantees {
collection, err := e.gateway.GetCollection(guarantee.CollectionID)
if err != nil {
+ e.logger.StopProgress()
return nil, nil, nil, err
}
collections = append(collections, collection)
