Skip to content

Commit b08fc36

Browse files
committed
rename to ServerErrorCode
1 parent f1c91ef commit b08fc36

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

livekit-api/livekit/api/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,13 @@
3636
from livekit.protocol.connector_whatsapp import *
3737
from livekit.protocol.connector_twilio import *
3838

39-
from .twirp_client import ServerError, SipCallError, TwirpError, TwirpErrorCode
39+
from .twirp_client import (
40+
ServerError,
41+
ServerErrorCode,
42+
SipCallError,
43+
TwirpError,
44+
TwirpErrorCode,
45+
)
4046
from .livekit_api import LiveKitAPI
4147
from .access_token import (
4248
InferenceGrants,
@@ -65,6 +71,7 @@
6571
"TokenVerifier",
6672
"WebhookReceiver",
6773
"ServerError",
74+
"ServerErrorCode",
6875
"TwirpError",
6976
"TwirpErrorCode",
7077
"SipCallError",

livekit-api/livekit/api/twirp_client.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def __str__(self) -> str:
126126
TwirpError = ServerError
127127

128128

129-
class TwirpErrorCode:
129+
class ServerErrorCode:
130130
CANCELED = "canceled"
131131
UNKNOWN = "unknown"
132132
INVALID_ARGUMENT = "invalid_argument"
@@ -147,6 +147,10 @@ class TwirpErrorCode:
147147
DATA_LOSS = "dataloss"
148148

149149

150+
# Deprecated alias for :class:`ServerErrorCode`, kept for backwards compatibility.
151+
TwirpErrorCode = ServerErrorCode
152+
153+
150154
T = TypeVar("T", bound=Message)
151155

152156

0 commit comments

Comments
 (0)