type errors

This commit is contained in:
Alex Holliday
2025-07-25 10:19:22 -07:00
parent dc321580c3
commit 3059e730e2
+3 -3
View File
@@ -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) => ({