From e780d97c3d17b976e73f88bb7a07903e6d428ac0 Mon Sep 17 00:00:00 2001 From: Robonau <30987265+Robonau@users.noreply.github> Date: Mon, 11 Nov 2024 19:58:38 +0000 Subject: [PATCH] better errors --- src/widgets/suwayomi/proxy.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/widgets/suwayomi/proxy.js b/src/widgets/suwayomi/proxy.js index 014021600..019a9201a 100644 --- a/src/widgets/suwayomi/proxy.js +++ b/src/widgets/suwayomi/proxy.js @@ -216,15 +216,13 @@ export default async function suwayomiProxyHandler(req, res) { }); if (status === 401) { - logger.error("unauthorized username or password for Suwayomi is incorrect."); - return res - .status(401) - .send({ error: { message: "401: unauthorized username or password for Suwayomi is incorrect." } }); + logger.error("Invalid or missing username or password for service '%s' in group '%s'", service, group); + return res.status(401).send({ error: { message: "401: unauthorized, username or password is incorrect." } }); } if (status !== 200) { logger.error("Error getting data from Suwayomi: %d. Data: %s", status, data); - return res.status(status).send({ error: { message: "Error getting data from Suwayomi", body, data } }); + return res.status(status).send({ error: { message: "Error getting data. body: %s, data: %s", body, data } }); } /** @type {ResponseJSON|ResponseJSONcategory} */