Fix: only log errors directly if exist

This commit is contained in:
shamoon 2024-02-28 11:44:32 -08:00
parent 68e4b98ddb
commit e92ccc30ba
14 changed files with 16 additions and 16 deletions

View file

@ -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()}` } });
}