mirror of
https://github.com/livekit/livekit.git
synced 2026-08-29 07:39:09 +00:00
convert psprc error to http code in rtc service failure response (#3187)
This commit is contained in:
@@ -242,7 +242,12 @@ func (s *RTCService) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
if err != nil {
|
||||
prometheus.IncrementParticipantJoinFail(1)
|
||||
handleError(w, r, http.StatusInternalServerError, err, loggerFields...)
|
||||
status := http.StatusInternalServerError
|
||||
var psrpcErr psrpc.Error
|
||||
if errors.As(err, &psrpcErr) {
|
||||
status = psrpcErr.ToHttp()
|
||||
}
|
||||
handleError(w, r, status, err, loggerFields...)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user