mirror of
https://github.com/sp-tarkov/server.git
synced 2025-02-13 06:30:43 -05:00
Log file errors when performing imageRoute lookup
This commit is contained in:
parent
bd00542793
commit
ae0e271957
@ -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}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user