Gardian Memeti
10/04/2021, 2:15 PMRyan
10/04/2021, 2:26 PMtry/catch
should work here.
What have you currently implemented?Gardian Memeti
10/04/2021, 2:28 PMapp.get('/monitoring', async (req, res) => {
try{
const count = await prisma.users.count();
if (count) {
res.status(200).json({
"Status": 'OK',
"v": module.exports.version
})
} else {
throw error
}
}catch(err){
console.log(JSON.stringify(err),'error')
console.log(err,'error')
res.status(500).json({
"Status": "Not OK",
"v": module.exports.version,
"message":err.message
})
}
Gardian Memeti
10/04/2021, 2:29 PM