diff --git a/scripts/update.js b/scripts/update.js index ffd4350..a7f32c3 100755 --- a/scripts/update.js +++ b/scripts/update.js @@ -146,7 +146,13 @@ function isNotRustRelease({tag_name}) else if(ts.isFunctionDeclaration(node)) { if(functionIdentifiers.includes(node.name?.text)) - content.push(node.getFullText(sourceFile)); + { + let line = node.getFullText(sourceFile) + + line = line.replace('UnsupportedError', '/*Unsupported*/Error') + + content.push(line); + } } }); diff --git a/src/ortc.ts b/src/ortc.ts index cab5158..370d391 100644 --- a/src/ortc.ts +++ b/src/ortc.ts @@ -99,7 +99,7 @@ export function generateRouterRtpCapabilities( ); if (!matchedSupportedCodec) { - throw new UnsupportedError( + throw new /*Unsupported*/Error( `media codec not supported [mimeType:${mediaCodec.mimeType}]`, ); } @@ -207,7 +207,7 @@ export function getProducerRtpParametersMapping( ); if (!matchedCapCodec) { - throw new UnsupportedError( + throw new /*Unsupported*/Error( `unsupported codec [mimeType:${codec.mimeType}, payloadType:${codec.payloadType}]`, ); } @@ -242,7 +242,7 @@ export function getProducerRtpParametersMapping( ); if (!associatedCapRtxCodec) { - throw new UnsupportedError( + throw new /*Unsupported*/Error( `no RTX codec for capability codec PT ${ capMediaCodec!.preferredPayloadType }`, @@ -501,7 +501,7 @@ export function getConsumerRtpParameters({ consumerParams.codecs.length === 0 || isRtxCodec(consumerParams.codecs[0]) ) { - throw new UnsupportedError('no compatible media codecs'); + throw new /*Unsupported*/Error('no compatible media codecs'); } consumerParams.headerExtensions =