Add TwirpRequestStatusReporter twirp server hook to count requests (#1309)
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
"github.com/livekit/protocol/livekit"
|
||||
"github.com/livekit/protocol/logger"
|
||||
"github.com/livekit/protocol/utils"
|
||||
"github.com/twitchtv/twirp"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/telemetry"
|
||||
)
|
||||
@@ -301,7 +302,7 @@ func (s *EgressService) StopEgress(ctx context.Context, req *livekit.StopEgressR
|
||||
} else {
|
||||
if info.Status != livekit.EgressStatus_EGRESS_STARTING &&
|
||||
info.Status != livekit.EgressStatus_EGRESS_ACTIVE {
|
||||
return nil, fmt.Errorf("egress with status %s cannot be stopped", info.Status.String())
|
||||
return nil, twirp.NewError(twirp.FailedPrecondition, fmt.Sprintf("egress with status %s cannot be stopped", info.Status.String()))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user