Documentation Index Fetch the complete documentation index at: https://mintlify.com/moqtail/moqtail/llms.txt
Use this file to discover all available pages before exploring further.
Overview
This page documents all error codes and status codes used in the MOQT protocol. These codes are returned in error response messages to indicate why a request failed.
Termination Codes
Termination codes are used when closing a MOQT connection to indicate the reason for termination.
enum TerminationCode {
NO_ERROR = 0x0 ,
INTERNAL_ERROR = 0x1 ,
UNAUTHORIZED = 0x2 ,
PROTOCOL_VIOLATION = 0x3 ,
INVALID_REQUEST_ID = 0x4 ,
DUPLICATE_TRACK_ALIAS = 0x5 ,
KEY_VALUE_FORMATTING_ERROR = 0x6 ,
TOO_MANY_REQUESTS = 0x7 ,
INVALID_PATH = 0x8 ,
MALFORMED_PATH = 0x9 ,
GOAWAY_TIMEOUT = 0x10 ,
CONTROL_MESSAGE_TIMEOUT = 0x11 ,
DATA_STREAM_TIMEOUT = 0x12 ,
AUTH_TOKEN_CACHE_OVERFLOW = 0x13 ,
DUPLICATE_AUTH_TOKEN_ALIAS = 0x14 ,
VERSION_NEGOTIATION_FAILED = 0x15 ,
MALFORMED_AUTH_TOKEN = 0x16 ,
UNKNOWN_AUTH_TOKEN_ALIAS = 0x17 ,
EXPIRED_AUTH_TOKEN = 0x18 ,
INVALID_AUTHORITY = 0x19 ,
MALFORMED_AUTHORITY = 0x1a ,
}
Show Termination Code Details
Normal closure, no error occurred
Server encountered an internal error
Client is not authorized to perform the operation
Client violated the MOQT protocol specification
Request ID is invalid or out of sequence
Track alias is already in use
KEY_VALUE_FORMATTING_ERROR
Key-value pair is incorrectly formatted
Client has exceeded the request rate limit
Server is shutting down, GOAWAY timeout exceeded
VERSION_NEGOTIATION_FAILED
Client and server could not agree on a protocol version
Subscribe Error Codes
Returned in SubscribeError messages when a subscription request fails.
enum SubscribeErrorCode {
InternalError = 0x0 ,
Unauthorized = 0x1 ,
Timeout = 0x2 ,
NotSupported = 0x3 ,
TrackDoesNotExist = 0x4 ,
InvalidRange = 0x5 ,
MalformedAuthToken = 0x10 ,
ExpiredAuthToken = 0x12 ,
}
Server encountered an internal error processing the subscription
Client is not authorized to subscribe to this track
Subscription request timed out
Server does not support subscribing to this track
The requested track does not exist
The requested range is invalid (e.g., end < start)
Authorization token is malformed or cannot be parsed
Authorization token has expired
Fetch Error Codes
Returned in FetchError messages when a fetch request fails.
enum FetchErrorCode {
InternalError = 0x0 ,
Unauthorized = 0x1 ,
Timeout = 0x2 ,
NotSupported = 0x3 ,
TrackDoesNotExist = 0x4 ,
InvalidRange = 0x5 ,
NoObjects = 0x6 ,
InvalidJoiningRequestId = 0x7 ,
UnknownStatusInRange = 0x8 ,
MalformedTrack = 0x9 ,
MalformedAuthToken = 0x10 ,
ExpiredAuthToken = 0x12 ,
}
No objects exist in the requested range
The joining request ID does not refer to a valid subscription
Track status is unknown for objects in the requested range
Track structure is malformed or corrupt
PublishNamespace Error Codes
Returned in PublishNamespaceError messages when a namespace announcement fails.
enum PublishNamespaceErrorCode {
InternalError = 0x0 ,
Unauthorized = 0x1 ,
Timeout = 0x2 ,
NotSupported = 0x3 ,
Uninterested = 0x4 ,
MalformedAuthToken = 0x10 ,
UnknownAuthTokenAlias = 0x11 ,
ExpiredAuthToken = 0x12 ,
}
Server has no subscribers interested in this namespace
Referenced auth token alias is unknown
SubscribeNamespace Error Codes
Returned in SubscribeNamespaceError messages when a namespace subscription fails.
enum SubscribeNamespaceErrorCode {
InternalError = 0x0 ,
Unauthorized = 0x1 ,
Timeout = 0x2 ,
NotSupported = 0x3 ,
NamespacePrefixUnknown = 0x4 ,
NamespacePrefixOverlap = 0x5 ,
MalformedAuthToken = 0x10 ,
ExpiredAuthToken = 0x12 ,
}
The namespace prefix does not match any known namespace
The namespace prefix overlaps with an existing subscription
Track Status Codes
Returned in TrackStatusOk messages to indicate track availability.
enum TrackStatusCode {
InProgress = 0x00 ,
DoesNotExist = 0x01 ,
NotYetBegun = 0x02 ,
Finished = 0x03 ,
RelayUnavailable = 0x04 ,
}
Track is actively being published and available for subscription
Track does not exist or has never existed
Track is scheduled to exist but has not started yet
Track has completed and no more objects will be published
Relay cannot provide status information for this track
PublishDone Status Codes
Returned in PublishDone messages to indicate why object delivery has stopped.
enum PublishDoneStatusCode {
InternalError = 0x0 ,
Unauthorized = 0x1 ,
TrackEnded = 0x2 ,
SubscriptionEnded = 0x3 ,
GoingAway = 0x4 ,
Expired = 0x5 ,
TooFarBehind = 0x6 ,
}
Subscription was terminated by the client
Client is too far behind and cannot catch up
Publish Error Codes
Returned in PublishError messages when a publish request fails.
enum PublishErrorCode {
InternalError = 0x0 ,
Unauthorized = 0x1 ,
Timeout = 0x2 ,
NotSupported = 0x3 ,
InvalidNamespace = 0x4 ,
InvalidTrackName = 0x5 ,
MalformedAuthToken = 0x10 ,
UnknownAuthTokenAlias = 0x11 ,
ExpiredAuthToken = 0x12 ,
}
The namespace has not been announced or is invalid
The track name is invalid or malformed
Usage Examples
Handle Subscribe Error
import { SubscribeErrorCode } from 'moqtail'
subscription . onError (( error ) => {
switch ( error . errorCode ) {
case SubscribeErrorCode . TrackDoesNotExist :
console . error ( 'Track not found' )
break
case SubscribeErrorCode . Unauthorized :
console . error ( 'Not authorized to subscribe' )
// Prompt for credentials
break
case SubscribeErrorCode . InvalidRange :
console . error ( 'Invalid subscription range' )
// Adjust range and retry
break
default :
console . error ( `Subscribe failed: ${ error . reasonPhrase } ` )
}
})
Handle Track Status
import { TrackStatusCode } from 'moqtail'
const response = await queryTrackStatus ( trackName )
switch ( response . statusCode ) {
case TrackStatusCode . InProgress :
console . log ( 'Track is live, subscribing...' )
subscribe ( trackName )
break
case TrackStatusCode . Finished :
console . log ( 'Track has ended, fetching archive' )
fetchArchive ( trackName )
break
case TrackStatusCode . NotYetBegun :
console . log ( 'Track scheduled for future, waiting...' )
waitForTrack ( trackName )
break
case TrackStatusCode . DoesNotExist :
console . error ( 'Track does not exist' )
break
}
Parse Termination Code
import { TerminationCode } from 'moqtail'
connection . onClose (( code ) => {
const termCode = TerminationCode . tryFrom ( code )
switch ( termCode ) {
case TerminationCode . NO_ERROR :
console . log ( 'Connection closed normally' )
break
case TerminationCode . PROTOCOL_VIOLATION :
console . error ( 'Protocol violation detected' )
break
case TerminationCode . VERSION_NEGOTIATION_FAILED :
console . error ( 'Could not agree on protocol version' )
break
default :
console . error ( `Connection terminated: ${ termCode } ` )
}
})
Error Handling Best Practices
Always check error codes before error messages. Error codes are standardized, while reason phrases are human-readable and may vary.
Retry Strategy: Not all errors are retryable. Unauthorized, TrackDoesNotExist, and InvalidRange typically require user action or configuration changes.
Logging: Include both the error code and reason phrase in logs for easier debugging.
See Also