Error handling removed
This commit is contained in:
1 parent
de6d2457c0
commit
e76bee70d6
1 file changed
+3
-9
@@ -44,15 +44,9 @@ const getChecks = async (req, res, next) => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const checks = await req.db.getChecks(req.params.monitorId);
|
const checks = await req.db.getChecks(req.params.monitorId);
|
||||||
if (checks) {
|
return res
|
||||||
return res
|
.status(200)
|
||||||
.status(200)
|
.json({ success: true, msg: successMessages.CHECK_GET, data: checks });
|
||||||
.json({ success: true, msg: successMessages.CHECK_GET, data: checks });
|
|
||||||
} else {
|
|
||||||
return res
|
|
||||||
.status(404)
|
|
||||||
.json({ success: false, msg: errorMessages.CHECKS_NOT_FOUND, data: [] })
|
|
||||||
}
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
error.service = SERVICE_NAME;
|
error.service = SERVICE_NAME;
|
||||||
next(error);
|
next(error);
|
||||||
|
|||||||
Reference in new issue
Block a user