Skip to content

Commit

Permalink
Replace UnsupportedError class for regular Error
Browse files Browse the repository at this point in the history
  • Loading branch information
piranna committed Jan 11, 2024
1 parent 7039da8 commit 57f9782
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
8 changes: 7 additions & 1 deletion scripts/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.replaceAll('UnsupportedError', '/*Unsupported*/Error')

content.push(line);
}
}
});

Expand Down
8 changes: 4 additions & 4 deletions src/ortc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export function generateRouterRtpCapabilities(
);

if (!matchedSupportedCodec) {
throw new UnsupportedError(
throw new /*Unsupported*/Error(
`media codec not supported [mimeType:${mediaCodec.mimeType}]`,
);
}
Expand Down Expand Up @@ -207,7 +207,7 @@ export function getProducerRtpParametersMapping(
);

if (!matchedCapCodec) {
throw new UnsupportedError(
throw new /*Unsupported*/Error(
`unsupported codec [mimeType:${codec.mimeType}, payloadType:${codec.payloadType}]`,
);
}
Expand Down Expand Up @@ -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
}`,
Expand Down Expand Up @@ -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 =
Expand Down

0 comments on commit 57f9782

Please sign in to comment.