Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/rpc-connection-closed-error-code.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@livekit/protocol": patch
---

Add the `DataChannelRpcConnectionClosed` (1506, "Connection closed") data channel RPC error code, used by the client SDKs when the caller's own room disconnects while a call is in flight
4 changes: 4 additions & 0 deletions utils/data_channel_rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const (
DataChannelRpcRecipientDisconnected
DataChannelRpcResponsePayloadTooLarge
DataChannelRpcSendFailed
DataChannelRpcConnectionClosed
)

const (
Expand All @@ -41,6 +42,7 @@ var dataChannelRpcErrorMessages = map[DataChannelRpcErrorCode]string{
DataChannelRpcRecipientDisconnected: "Recipient disconnected",
DataChannelRpcResponsePayloadTooLarge: "Response payload too large",
DataChannelRpcSendFailed: "Failed to send",
DataChannelRpcConnectionClosed: "Connection closed",

DataChannelRpcUnsupportedMethod: "Method not supported at destination",
DataChannelRpcRecipientNotFound: "Recipient not found",
Expand Down Expand Up @@ -76,6 +78,8 @@ func (e *DataChannelRpcError) PsrpcError() psrpc.Error {
return psrpc.NewError(psrpc.MalformedResponse, e)
case DataChannelRpcSendFailed:
return psrpc.NewError(psrpc.Internal, e)
case DataChannelRpcConnectionClosed:
return psrpc.NewError(psrpc.Unavailable, e)
case DataChannelRpcUnsupportedMethod:
return psrpc.NewError(psrpc.InvalidArgument, e)
case DataChannelRpcRecipientNotFound:
Expand Down
Loading