theSoberSobber / AlertBot

Alert Bot for Colleges! (yes, for all of em!)
https://alertbot.vercel.app
GNU General Public License v3.0
4 stars 0 forks source link

groupIds JSON object fetch failing #6

Closed theSoberSobber closed 1 year ago

theSoberSobber commented 1 year ago

When groupId Json object fetch fails then AlertBot throws a JSON.parse error as when groupIds is down there is a 404 page instead of that which it tries to parse and hence throws the error that html is not json

A copy of the error

<!DOCTYPE html> ^ SyntaxError: Unexpected token < in JSON at position 0 at JSON.parse () at main (/data/data/com.termux/files/home/AlertBot/main.js:56:39) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v18.12.1 error Command failed with exit code 1.

theSoberSobber commented 1 year ago

there is a temporary info.jso fix but the future could include caching the latest link and updating cache with cron tab scheduling

theSoberSobber commented 1 year ago

groupIds are now obtained locally