mirror of
https://github.com/livekit/livekit.git
synced 2026-10-22 13:12:09 +00:00
convert psprc error to http code in rtc service failure response (#3187)
This commit is contained in:
1 parent
d0343808f2
commit
73fbc6b8bb
1 file changed
+6
-1
@@ -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