aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsotech117 <michael_foiani@brown.edu>2025-08-27 00:25:03 -0400
committersotech117 <michael_foiani@brown.edu>2025-08-27 00:25:03 -0400
commitdc3971d10f47354803c62a744af2b88acd371130 (patch)
tree1524cd640d6e9e87a2788980e0cea85233795af7
parent904fe73598ab0d424acb9664d501b229f00d30a0 (diff)
propogate errors to res
-rw-r--r--server.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/server.js b/server.js
index 88a7c42..f5a15cd 100644
--- a/server.js
+++ b/server.js
@@ -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