Closed FinlayDaG33k closed 3 years ago
Hi @FinlayDaG33k I have just tried to raise exception and handling it within the try-catch which worked as expected for me. Please have a look on these code and the output. This job executed on every 10th second even the job threw the exception.
Output:
Please double check your exception handling, hope this example helps. Thank you. 🙂
Thanks for the reply.
I'll see if there is anything else in my code that may cause the issue.
I'll close this issue for now and re-open it if the need arises :)
Durr, the issue was kinda stupid...
I have a property in my class isRunning
that prevents the check from running if it's still doing stuff....
But if the exception occurs during the fetch
, this never gets set to false
again, preventing the code from ever running again...
hii there,
I have some cronjobs using this that rely on
fetch
to get some data from external APIs.However, sometimes, the internet is offline during the moments these fetches happen.
I cleanly catch these errors like this:
The console shows that it was caught just fine:
But the cronjob is never run after this again (the only way to fix it, is to re-register the job in the code or restart the Deno process all together).