revoke_stop fixed

This commit is contained in:
2026-02-25 15:32:30 +05:30
parent 68d0bf0151
commit f81c9c4de1

View File

@@ -107,8 +107,18 @@ const revokeStop = async (req, res) => {
console.log('response from stop cheque api: ', response.data); console.log('response from stop cheque api: ', response.data);
return res.json(response.data); return res.json(response.data);
} catch (error) { } catch (e) {
logger.error('Unable to fetch cheque data: ', error); logger.error('Unable to fetch cheque data: ', e);
if (axios.isAxiosError(e)) {
if (e.response) {
// Server responded with a status outside 2xx
return res.status(e.response.status).json(e.response.data);
} else {
return res
.status(e.response.status)
.json({ error: 'UNKNOWN', message: 'NO_RESPONSE_FROM_CBS' });
}
}
return res.status(500).json({ error: 'INTERNAL_SERVER_ERROR' }); return res.status(500).json({ error: 'INTERNAL_SERVER_ERROR' });
} }
}; };