diff --git a/packages/runner/index.ts b/packages/runner/index.ts index 2df926a..588ba99 100644 --- a/packages/runner/index.ts +++ b/packages/runner/index.ts @@ -23,7 +23,7 @@ if (configs.length === 0) { } // running through configs -for (const config in configs) +for (const config in configs) { // check for cron if (!config.hasOwnProperty('cron')) { @@ -35,6 +35,10 @@ for (const config in configs) * */ const task = cron.schedule(config.cron, async() => { - const docket = await run(config, docket) + try { + const docket = await run(config, docket) + } catch(error) { + logger(config.slug).error(error) + } }) } diff --git a/packages/runner/single.ts b/packages/runner/single.ts index 3a3a210..af393db 100644 --- a/packages/runner/single.ts +++ b/packages/runner/single.ts @@ -32,4 +32,9 @@ if (configs.length === 0) { } const config = configs[0] -const docket = await run(config) + +try { + const docket = await run(config) +} catch(error) { + logger(config.slug).error(error) +}