Merge pull request #738 from lanzafame/feat/add-trace-error-status
add error status to trace
This commit is contained in:
commit
835e9dd1f6
@ -446,11 +446,19 @@ func (syncer *Syncer) Sync(ctx context.Context, maybeHead *types.TipSet) error {
|
||||
|
||||
if err := syncer.collectChain(ctx, maybeHead); err != nil {
|
||||
span.AddAttributes(trace.StringAttribute("col_error", err.Error()))
|
||||
span.SetStatus(trace.Status{
|
||||
Code: 13,
|
||||
Message: err.Error(),
|
||||
})
|
||||
return xerrors.Errorf("collectChain failed: %w", err)
|
||||
}
|
||||
|
||||
if err := syncer.store.PutTipSet(ctx, maybeHead); err != nil {
|
||||
span.AddAttributes(trace.StringAttribute("put_error", err.Error()))
|
||||
span.SetStatus(trace.Status{
|
||||
Code: 13,
|
||||
Message: err.Error(),
|
||||
})
|
||||
return xerrors.Errorf("failed to put synced tipset to chainstore: %w", err)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user