diff options
-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 |