fix: add missing span.SetStatus(codes.Error) (#86)
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: twhelp/core#86
This commit is contained in:
parent
7415d32923
commit
4f96cdf202
|
@ -88,6 +88,7 @@ func (e *Ennoblement) Refresh(ctx context.Context, key, url string) error {
|
|||
}
|
||||
if err := e.repo.Create(ctx, params...); err != nil {
|
||||
span.RecordError(err)
|
||||
span.SetStatus(codes.Error, err.Error())
|
||||
return fmt.Errorf("EnnoblementRepository.Create: %w", err)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -90,6 +90,7 @@ func (p *Player) createOrUpdate(ctx context.Context, key string, players []domai
|
|||
}
|
||||
if err := p.repo.CreateOrUpdate(ctx, params...); err != nil {
|
||||
span.RecordError(err)
|
||||
span.SetStatus(codes.Error, err.Error())
|
||||
return fmt.Errorf("PlayerRepository.CreateOrUpdate: %w", err)
|
||||
}
|
||||
}
|
||||
|
@ -126,6 +127,7 @@ func (p *Player) delete(ctx context.Context, key string, existing []domain.BaseP
|
|||
})
|
||||
if err != nil {
|
||||
span.RecordError(err)
|
||||
span.SetStatus(codes.Error, err.Error())
|
||||
return fmt.Errorf("PlayerRepository.List: %w", err)
|
||||
}
|
||||
|
||||
|
|
|
@ -91,6 +91,7 @@ func (t *Tribe) createOrUpdate(ctx context.Context, key string, tribes []domain.
|
|||
}
|
||||
if err := t.repo.CreateOrUpdate(ctx, params...); err != nil {
|
||||
span.RecordError(err)
|
||||
span.SetStatus(codes.Error, err.Error())
|
||||
return fmt.Errorf("TribeRepository.CreateOrUpdate: %w", err)
|
||||
}
|
||||
}
|
||||
|
@ -127,6 +128,7 @@ func (t *Tribe) delete(ctx context.Context, key string, existing []domain.BaseTr
|
|||
})
|
||||
if err != nil {
|
||||
span.RecordError(err)
|
||||
span.SetStatus(codes.Error, err.Error())
|
||||
return fmt.Errorf("TribeRepository.List: %w", err)
|
||||
}
|
||||
|
||||
|
|
|
@ -78,6 +78,7 @@ func (v *Village) Refresh(ctx context.Context, key, url string) (domain.RefreshV
|
|||
}
|
||||
if err := v.repo.CreateOrUpdate(ctx, params...); err != nil {
|
||||
span.RecordError(err)
|
||||
span.SetStatus(codes.Error, err.Error())
|
||||
return domain.RefreshVillagesResult{}, fmt.Errorf("VillageRepository.CreateOrUpdate: %w", err)
|
||||
}
|
||||
}
|
||||
|
|
Reference in New Issue
Block a user