feat: improve error logs for stremthru/mediaflow

This commit is contained in:
Viren070
2025-05-04 19:57:12 +01:00
parent 71cc439ee0
commit 09220be8e8
2 changed files with 10 additions and 2 deletions
+5 -1
View File
@@ -118,7 +118,7 @@ export async function getMediaFlowPublicIp(
const mediaFlowUrl = new URL(mediaFlowConfig.proxyUrl.replace(/\/$/, ''));
if (PRIVATE_CIDR.test(mediaFlowUrl.hostname)) {
// MediaFlow proxy URL is a private IP address
logger.debug(
logger.error(
'MediaFlow proxy URL is a private IP address so returning null'
);
return null;
@@ -162,6 +162,10 @@ export async function getMediaFlowPublicIp(
const publicIp = data.ip;
if (publicIp && cache) {
cache.set(cacheKey, publicIp, Settings.CACHE_MEDIAFLOW_IP_TTL);
} else {
logger.error(
`MediaFlow did not respond with a public IP. Response: ${JSON.stringify(data)}`
);
}
return publicIp;
} catch (error: any) {
+5 -1
View File
@@ -118,7 +118,7 @@ export async function getStremThruPublicIp(
const stremThruUrl = new URL(stremThruConfig.url.replace(/\/$/, ''));
if (PRIVATE_CIDR.test(stremThruUrl.hostname)) {
// StremThru URL is a private IP address
logger.debug('StremThru URL is a private IP address so returning null');
logger.error('StremThru URL is a private IP address so returning null');
return null;
}
@@ -157,6 +157,10 @@ export async function getStremThruPublicIp(
const publicIp = data.data?.ip?.machine;
if (publicIp && cache) {
cache.set(cacheKey, publicIp, Settings.CACHE_STREMTHRU_IP_TTL);
} else {
logger.error(
`StremThru did not respond with a public IP address, please check a valid credential was used. Response: ${JSON.stringify(data)}`
);
}
return publicIp;
} catch (error: any) {