correct error handling
This commit is contained in:
1 parent
36d78a9aa4
commit
342e67593b
1 file changed
+1
-2
@@ -649,9 +649,8 @@ class MonitorController {
|
|||||||
sendTestEmail = async (req, res, next) => {
|
sendTestEmail = async (req, res, next) => {
|
||||||
try {
|
try {
|
||||||
const { to } = req.body;
|
const { to } = req.body;
|
||||||
|
|
||||||
if (!to || typeof to !== "string") {
|
if (!to || typeof to !== "string") {
|
||||||
return res.error({ msg: this.stringService.errorForValidEmailAddress });
|
throw new Error(this.stringService.errorForValidEmailAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
const subject = this.stringService.testEmailSubject;
|
const subject = this.stringService.testEmailSubject;
|
||||||
|
|||||||
Reference in new issue
Block a user