diff options
author | Joel Kronqvist <joelkronqvist@proton.me> | 2023-06-26 17:22:32 +0000 |
---|---|---|
committer | Joel Kronqvist <joelkronqvist@proton.me> | 2023-06-26 17:22:32 +0000 |
commit | 330012395587fe87ce36c29b3c5d1941aa022d0b (patch) | |
tree | 7018bc2250937b5ed724d0b37e55d992a4d3d986 /update.js | |
parent | 7f59612f4ad1061c99ae53ef92baf04511b7f9af (diff) | |
download | LYLLRuoka-330012395587fe87ce36c29b3c5d1941aa022d0b.tar.gz LYLLRuoka-330012395587fe87ce36c29b3c5d1941aa022d0b.zip |
Diffstat (limited to 'update.js')
-rw-r--r-- | update.js | 18 |
1 files changed, 15 insertions, 3 deletions
@@ -14,9 +14,21 @@ async function buildDB(dbconnection, shiftPath, classPath, exceptionPath) { let classes = await openFile(classPath); classes = classes.toString('utf-8'); - await parseClasses(dbconnection, classes); - await parse.build(shiftCont, dbconnection); - await updateExceptions(exceptions, dbconnection); + try { + await parseClasses(dbconnection, classes); + } catch (e) { + throw new Error(`Virhe kurssitarjottimen osassa: ${e.message}`, { cause: e }); + } + try { + await parse.build(shiftCont, dbconnection); + } catch (e) { + throw new Error(`Virhe ruokailuvuoroissa: ${e.message}`, { cause: e }); + } + try { + await updateExceptions(exceptions, dbconnection); + } catch (e) { + throw new Error(`Virhe ilmoituksissa: ${e.message}`, { cause: e }); + } return 0; } |