From a1a208844a4789689feb5d159bf3a99bac2632c9 Mon Sep 17 00:00:00 2001 From: Sainan Date: Tue, 18 Mar 2025 11:06:41 +0100 Subject: [PATCH] log request body for unhandled operations --- src/controllers/api/guildTechController.ts | 2 ++ src/controllers/api/infestedFoundryController.ts | 1 + src/controllers/api/nemesisController.ts | 2 ++ 3 files changed, 5 insertions(+) diff --git a/src/controllers/api/guildTechController.ts b/src/controllers/api/guildTechController.ts index fab5cf0b..e1e79e8f 100644 --- a/src/controllers/api/guildTechController.ts +++ b/src/controllers/api/guildTechController.ts @@ -23,6 +23,7 @@ import { config } from "@/src/services/configService"; import { GuildPermission, ITechProjectClient, ITechProjectDatabase } from "@/src/types/guildTypes"; import { TGuildDatabaseDocument } from "@/src/models/guildModel"; import { toMongoDate } from "@/src/helpers/inventoryHelpers"; +import { logger } from "@/src/utils/logger"; export const guildTechController: RequestHandler = async (req, res) => { const accountId = await getAccountIdForRequest(req); @@ -219,6 +220,7 @@ export const guildTechController: RequestHandler = async (req, res) => { await guild.save(); res.end(); } else { + logger.debug(`data provided to ${req.path}: ${String(req.body)}`); throw new Error(`unknown guildTech action: ${data.Action}`); } }; diff --git a/src/controllers/api/infestedFoundryController.ts b/src/controllers/api/infestedFoundryController.ts index aa7c99f5..b4b2b4ba 100644 --- a/src/controllers/api/infestedFoundryController.ts +++ b/src/controllers/api/infestedFoundryController.ts @@ -357,6 +357,7 @@ export const infestedFoundryController: RequestHandler = async (req, res) => { } default: + logger.debug(`data provided to ${req.path}: ${String(req.body)}`); throw new Error(`unhandled infestedFoundry mode: ${String(req.query.mode)}`); } }; diff --git a/src/controllers/api/nemesisController.ts b/src/controllers/api/nemesisController.ts index 724d8c8e..550b2771 100644 --- a/src/controllers/api/nemesisController.ts +++ b/src/controllers/api/nemesisController.ts @@ -4,6 +4,7 @@ import { getAccountIdForRequest } from "@/src/services/loginService"; import { SRng } from "@/src/services/rngService"; import { IMongoDate } from "@/src/types/commonTypes"; import { IInfNode } from "@/src/types/inventoryTypes/inventoryTypes"; +import { logger } from "@/src/utils/logger"; import { RequestHandler } from "express"; import { ExportRegions } from "warframe-public-export-plus"; @@ -82,6 +83,7 @@ export const nemesisController: RequestHandler = async (req, res) => { target: inventory.toJSON().Nemesis }); } else { + logger.debug(`data provided to ${req.path}: ${String(req.body)}`); throw new Error(`unknown nemesis mode: ${String(req.query.mode)}`); } };