From 342e67593b1d83e651642c21c70eeec4a5c087c6 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Fri, 9 May 2025 14:53:53 -0700 Subject: [PATCH] correct error handling --- server/controllers/monitorController.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/controllers/monitorController.js b/server/controllers/monitorController.js index 5ab654375..9a42ea4e5 100755 --- a/server/controllers/monitorController.js +++ b/server/controllers/monitorController.js @@ -649,9 +649,8 @@ class MonitorController { sendTestEmail = async (req, res, next) => { try { const { to } = req.body; - if (!to || typeof to !== "string") { - return res.error({ msg: this.stringService.errorForValidEmailAddress }); + throw new Error(this.stringService.errorForValidEmailAddress); } const subject = this.stringService.testEmailSubject;