Skip to content

Commit

Permalink
Fix autoconversion of types.Error(nil) into non nil error (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
kirugan committed Jan 16, 2025
1 parent 154344c commit 1416e09
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions internal/services/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,7 @@ func (s *Service) processBlocksSequentially(ctx context.Context) error {
for i := lastProcessedHeight + 1; i <= uint64(latestHeight); i++ {
select {
case <-ctx.Done():
return types.NewError(
http.StatusInternalServerError,
types.InternalServiceError,
fmt.Errorf("context cancelled during block processing"),
)
return fmt.Errorf("context cancelled during block processing")
default:
events, err := s.getEventsFromBlock(ctx, int64(i))
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/services/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (s *Service) processEvent(
// process the event based on its type.
bbnEvent := event.Event

var err error
var err *types.Error

switch EventTypes(bbnEvent.Type) {
case EventFinalityProviderCreatedType:
Expand Down

0 comments on commit 1416e09

Please sign in to comment.