From 3059e730e2495039635e742b82cfe74cf600e9b2 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Fri, 25 Jul 2025 10:19:22 -0700 Subject: [PATCH] type errors --- server/service/business/monitorService.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/service/business/monitorService.js b/server/service/business/monitorService.js index a2bf06dfd..2a2b27aa3 100644 --- a/server/service/business/monitorService.js +++ b/server/service/business/monitorService.js @@ -90,7 +90,7 @@ class MonitorService { if (["port", "interval"].includes(header)) { const num = parseInt(value, 10); if (isNaN(num)) { - throw new Error(`${header} should be a valid number, got: ${value}`); + throw this.errorService.createBadRequestError(`${header} should be a valid number, got: ${value}`); } return num; } @@ -237,10 +237,10 @@ class MonitorService { }; exportMonitorsToCSV = async ({ teamId }) => { - const monitors = await this.monitorService.getMonitorsByTeamId({ teamId }); + const monitors = await this.db.getMonitorsByTeamId({ teamId }); if (!monitors || monitors.length === 0) { - throw new Error("No monitors to export"); + throw this.errorService.createNotFoundError("No monitors to export"); } const csvData = monitors?.filteredMonitors?.map((monitor) => ({