Fix: PR comments

This commit is contained in:
Br0wnHammer
2026-02-23 10:19:42 +05:30
parent 22b33d789c
commit ea086d6956
2 changed files with 6 additions and 3 deletions
@@ -352,6 +352,7 @@ class MongoMonitorsRepository implements IMonitorsRepository {
tempAlertCounter: doc.tempAlertCounter,
selectedDisks: doc.selectedDisks ?? [],
gameId: doc.gameId ?? undefined,
grpcServiceName: doc.grpcServiceName ?? undefined,
group: doc.group ?? null,
recentChecks: (doc.recentChecks ?? []).map((check: any) => this.toCheckSnapshot(check)),
createdAt: toDateString(doc.createdAt),
@@ -407,6 +408,7 @@ class MongoMonitorsRepository implements IMonitorsRepository {
tempAlertCounter: doc.tempAlertCounter,
selectedDisks: doc.selectedDisks ?? [],
gameId: doc.gameId ?? undefined,
grpcServiceName: doc.grpcServiceName ?? undefined,
group: doc.group ?? null,
recentChecks: (doc.recentChecks ?? []).map((check: any) => this.toCheckSnapshot(check)),
createdAt: toDateString(doc.createdAt),
@@ -1,6 +1,7 @@
import { HTTPError, RequestError } from "got";
import type { Got, Response } from "got";
import type { Monitor, MonitorStatusResponse, GrpcStatusPayload } from "@/types/index.js";
import { AppError } from "@/utils/AppError.js";
import path from "path";
import { fileURLToPath } from "url";
@@ -644,10 +645,10 @@ class NetworkService implements INetworkService {
const grpcServiceName = monitor.grpcServiceName || "";
if (!url) {
throw new Error("Monitor host is required");
throw new AppError({ message: "Monitor host is required", service: this.SERVICE_NAME, method: "requestGrpc" });
}
if (!port) {
throw new Error("Monitor port is required");
throw new AppError({ message: "Monitor port is required", service: this.SERVICE_NAME, method: "requestGrpc" });
}
const target = `${url}:${port}`;
@@ -700,7 +701,7 @@ class NetworkService implements INetworkService {
serviceName: grpcServiceName,
servingStatus: "UNKNOWN",
};
const grpcError = new Error(err.details || err.message);
const grpcError = new AppError({ message: err.details || err.message, service: this.SERVICE_NAME, method: "requestGrpc" });
(grpcError as any).grpcPayload = payload;
(grpcError as any).grpcCode = err.code;
reject(grpcError);