Comments (6)
Will have a look at that
from croner.
Thanks, I didn't expect to see it released that quickly!
I'm using TypeScript and I noticed a small typing issue:
cron("* * * * * *", () => {
throw new Error("err!");
},
{
// TS7006: Parameter 'e' implicitly has an 'any' type. (appears if strict mode is enabled)
// Can be fixed by adding `e: any`
catch(e) {
console.error("Error!", e);
},
}
);
It'd be beneficial for TS users to define the arguments explicitly, so the compiler knows there's an error
parameter:
catch?: boolean | ((error: unknown) => void);
from croner.
(Hopefully) resolved in
5.4.1
which will be released any minute +1
Yep, I can confirm it's fixed. Thanks!
from croner.
Released in 5.4.0
- give it a go!
Example (running on Deno):
import Cron from "https://deno.land/x/[email protected]/dist/croner.min.mjs";
const onError = (e) => console.error('Oh shit - ', e);
Cron("* * * * * *", { catch: onError },
() => {
console.log("This will run every second.");
throw new Error("t");
}
);
from croner.
Thanks for reporting (again)! Will have a look at that for 5.4.1.
from croner.
(Hopefully) resolved in 5.4.1
which will be released any minute
from croner.
Related Issues (20)
- Code size vs readability HOT 3
- Got `Invalid Date` with timezone on JSC HOT 2
- Not working with Node 19.1 HOT 7
- Feature: Over-run protection (Was: How detect overlapping?) HOT 6
- msToNext() is a negative number HOT 3
- Cron is not running as scheduled HOT 6
- Feature: add a list of scheduled jobs HOT 2
- How to clean up side effects? HOT 3
- Feature: Unref option HOT 1
- Feature: Method to trigger events manually HOT 2
- Bug: Types are not found wth `nodenext` module resolution HOT 9
- Feature: L for last weekday of month HOT 1
- Bug & Question: Handling of named jobs HOT 8
- Protect-option is not working in 6.0.0
- Cron job runs twice in PM2 HOT 3
- Feature request: Ability to change interval dynamically HOT 1
- Error on calling imported function HOT 4
- Week days triggering on wrong days (0 0 12 ? * MON) HOT 3
- Typo / incorrect way of importing Cron with CommonJS in the documentation HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from croner.