Commit d9caed6d authored by marioromera's avatar marioromera
Browse files

catch api call

parent f06b53c5
......@@ -115,14 +115,13 @@ async function calculatePadTfidf() {
async function getRevisions() {
if (!redis_connected) return;
let response;
try {
response = await fetch(
`${etherpadUrl}/api/1/getRevisionsCount?apikey=${etherpadApiKey}&padID=${PAD_ID}`
);
} catch (e) {
const 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