Commit f06b53c5 authored by marioromera's avatar marioromera
Browse files

trycatch revision api call

parent 781db388
......@@ -115,9 +115,14 @@ async function calculatePadTfidf() {
async function getRevisions() {
if (!redis_connected) return;
const response = await fetch(
`${etherpadUrl}/api/1/getRevisionsCount?apikey=${etherpadApiKey}&padID=${PAD_ID}`
);
let response;
try {
response = await fetch(
`${etherpadUrl}/api/1/getRevisionsCount?apikey=${etherpadApiKey}&padID=${PAD_ID}`
);
} catch (e) {
logger.warn('Connection error', e);
}
const etherpadJson = await response.json();
if (!etherpadJson.data) {
logger.warn('No revisions found');
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment