refactor(auth): error message for a more consistent format

This commit is contained in:
fallenbagel
2024-05-13 20:37:40 +05:00
parent 9576bc2edf
commit 82c252df31

View File

@@ -444,9 +444,15 @@ authRoutes.post('/jellyfin', async (req, res, next) => {
message: 'CREDENTIAL_ERROR_NO_SERVER_TYPE',
});
} else if (e.message === 'Connection_refused') {
logger.error(`Unable to connect to Jellyfin server at ${body.hostname}`, {
label: 'Auth',
});
logger.error(
`Unable to connect to ${
process.env.JELLYFIN_TYPE == 'emby' ? 'Emby' : 'Jellyfin'
} server`,
{
label: 'Auth',
hostname: body.hostname,
}
);
return next({
status: 503,
message: 'CONNECTION_REFUSED',