Add try catch for ping

pull/1529/head
shamoon 1 year ago
parent cead87dcd0
commit f1a33f10ed

@ -15,6 +15,7 @@ export default async function handler(req, res) {
});
}
try {
let startTime = performance.now();
let [status] = await httpProxy(pingURL, {
method: "HEAD"
@ -32,4 +33,10 @@ export default async function handler(req, res) {
status,
latency: endTime - startTime
});
} catch (e) {
logger.debug("Error attempting ping: %s", JSON.stringify(e));
return res.status(400).send({
error: 'Error attempting ping, see logs.',
});
}
}

Loading…
Cancel
Save