From ae0e27195735dcdf84c7d4d5e562ed0304bba5df Mon Sep 17 00:00:00 2001 From: Chomp Date: Thu, 9 Jan 2025 11:41:47 +0000 Subject: [PATCH] Log file errors when performing imageRoute lookup --- project/src/routers/ImageRouter.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/project/src/routers/ImageRouter.ts b/project/src/routers/ImageRouter.ts index d5ce247d..b970cff9 100644 --- a/project/src/routers/ImageRouter.ts +++ b/project/src/routers/ImageRouter.ts @@ -1,4 +1,5 @@ import { IncomingMessage, ServerResponse } from "node:http"; +import type { ILogger } from "@spt/models/spt/utils/ILogger"; import { ImageRouteService } from "@spt/services/mod/image/ImageRouteService"; import { FileSystemSync } from "@spt/utils/FileSystemSync"; import { HttpFileUtil } from "@spt/utils/HttpFileUtil"; @@ -7,6 +8,7 @@ import { inject, injectable } from "tsyringe"; @injectable() export class ImageRouter { constructor( + @inject("PrimaryLogger") protected logger: ILogger, @inject("ImageRouteService") protected imageRouteService: ImageRouteService, @inject("HttpFileUtil") protected httpFileUtil: HttpFileUtil, ) {} @@ -22,6 +24,8 @@ export class ImageRouter { // send image if (this.imageRouteService.existsByKey(url)) { await this.httpFileUtil.sendFileAsync(resp, this.imageRouteService.getByKey(url)); + } else { + this.logger.error(`File not found: ${url}`); } }