Skip to content

Commit f36afc9

Browse files
committed
start api call method
1 parent c92390c commit f36afc9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

scouterx/strace/tracemain.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ func StartApiCall(ctx context.Context, apiCallName string, address string) *netd
538538
return step
539539
}
540540

541-
func EndApiCall(ctx context.Context, step *netdata.MethodStep) {
541+
func EndApiCall(ctx context.Context, step *netdata.ApiCallStep, err error) {
542542
defer common.ReportScouterPanic()
543543

544544
if ctx == nil || step == nil {
@@ -549,6 +549,12 @@ func EndApiCall(ctx context.Context, step *netdata.MethodStep) {
549549
return
550550
}
551551
step.Elapsed = util.MillisToNow(tctx.StartTime) - step.StartTime
552+
if err != nil {
553+
step.Error = netio.SendError(err.Error())
554+
if tctx.Error == 0 {
555+
tctx.Error = step.Error
556+
}
557+
}
552558
tctx.Profile.Pop(step)
553559
}
554560

0 commit comments

Comments
 (0)