diff options
author | sotech117 <michael_foiani@brown.edu> | 2025-08-27 00:25:03 -0400 |
---|---|---|
committer | sotech117 <michael_foiani@brown.edu> | 2025-08-27 00:25:03 -0400 |
commit | dc3971d10f47354803c62a744af2b88acd371130 (patch) | |
tree | 1524cd640d6e9e87a2788980e0cea85233795af7 | |
parent | 904fe73598ab0d424acb9664d501b229f00d30a0 (diff) |
propogate errors to res
-rw-r--r-- | server.js | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -26,7 +26,7 @@ const screenAndUpload = async () => { await runUpload(); } catch (error) { console.error('Error occurred while running screener and upload:', error); - return Error('Failed to run screener and upload'); + throw new Error('Failed to run screener and upload'); } } @@ -53,7 +53,7 @@ const main = () => { }).catch((error) => { console.error('Error occurred while updating stock screener:', error); res.writeHead(500, { 'Content-Type': 'text/plain' }); - res.end('Internal Server Error'); + res.end('Internal Server Error. Please try again later (limit of once per day).'); }); } else { // throw a 403 @@ -553,5 +553,6 @@ const runUpload = async () => { // console.log('Batch update response:', response); } catch (error) { console.error('Error:', error); + throw new Error('Failed to upload to Google Sheets'); } }
\ No newline at end of file |