From e33bbb0f9561e2f8993490894f8f4651f422780e Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Wed, 2 Apr 2025 22:26:05 +0200 Subject: [PATCH] log caught member insert errors for debugging purposes --- src/controllers/api/addToGuildController.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/controllers/api/addToGuildController.ts b/src/controllers/api/addToGuildController.ts index a069220f..d2a89df4 100644 --- a/src/controllers/api/addToGuildController.ts +++ b/src/controllers/api/addToGuildController.ts @@ -42,6 +42,7 @@ export const addToGuildController: RequestHandler = async (req, res) => { status: 2 // outgoing invite }); } catch (e) { + logger.debug(`guild invite failed due to ${String(e)}`); res.status(400).json("User already invited to clan"); return; } @@ -87,7 +88,7 @@ export const addToGuildController: RequestHandler = async (req, res) => { RequestExpiry: new Date(Date.now() + 14 * 86400 * 1000) // TOVERIFY: I can't find any good information about this with regards to live, but 2 weeks seem reasonable. }); } catch (e) { - // Assuming this is "E11000 duplicate key error" due to the guildId-accountId unique index. + logger.debug(`alliance invite failed due to ${String(e)}`); res.status(400).send("Already requested"); } res.end();