mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-10 15:28:47 +00:00
Fix: only log errors directly if exist
This commit is contained in:
parent
68e4b98ddb
commit
e92ccc30ba
14 changed files with 16 additions and 16 deletions
|
@ -63,7 +63,7 @@ export default async function audiobookshelfProxyHandler(req, res) {
|
|||
|
||||
return res.status(200).send(libraryStats);
|
||||
} catch (e) {
|
||||
logger.error(e.message);
|
||||
if (e) logger.error(e);
|
||||
return res.status(500).send({ error: { message: e.message } });
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ export default async function gamedigProxyHandler(req, res) {
|
|||
ping: serverData.ping,
|
||||
});
|
||||
} catch (e) {
|
||||
logger.error(e);
|
||||
if (e) logger.error(e);
|
||||
|
||||
res.status(200).send({
|
||||
online: false,
|
||||
|
|
|
@ -18,7 +18,7 @@ export default async function minecraftProxyHandler(req, res) {
|
|||
players: pingResponse.players,
|
||||
});
|
||||
} catch (e) {
|
||||
logger.error(e);
|
||||
if (e) logger.error(e);
|
||||
res.status(200).send({
|
||||
version: undefined,
|
||||
online: false,
|
||||
|
|
|
@ -103,7 +103,7 @@ export default async function pyloadProxyHandler(req, res) {
|
|||
}
|
||||
}
|
||||
} catch (e) {
|
||||
logger.error(e);
|
||||
if (e) logger.error(e);
|
||||
return res.status(500).send({ error: { message: `Error communicating with Pyload API: ${e.toString()}` } });
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue