From b4bcb0912c5fe1c7f00c7ac76e5b67620781d3cc Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Thu, 20 Apr 2023 16:20:07 +0200 Subject: Updated 12 files and added 3 files (automated) --- includes/external/school/index.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'includes/external/school') diff --git a/includes/external/school/index.js b/includes/external/school/index.js index 58947ec..00f3435 100644 --- a/includes/external/school/index.js +++ b/includes/external/school/index.js @@ -6,6 +6,11 @@ const url = config.pronote.url; const username = config.pronote.user; const password = config.pronote.password; +process.on('unhandledRejection', (e) => { + console.error(e); + process.exit(2); +}) + async function getTimetable(offset, last) { const timetable = lessons; @@ -129,8 +134,12 @@ async function display(offset) { } (async () => { + console.log("Logging in..."); + console.log("URL is", url + ", username is", username + ", password is", password); global.session = await pronote.login(url, username, password); + console.log("Gathering timetable..."); global.lessons = await session.timetable(new Date(new Date() - (86400000 * 3)), new Date(new Date().getTime() + (86400000 * 7))); + console.log("Processing..."); await updateSleepTime(0); await display(-2); -- cgit