agenda 6.2.4 → 6.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +14 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -313,6 +313,20 @@ agenda.on('start:send email', (job) => { /* ... */ });
313
313
  agenda.on('fail:send email', (err, job) => { /* ... */ });
314
314
  ```
315
315
 
316
+ Use `fail` listeners to capture richer error context, such as stack traces,
317
+ without storing large payloads in `job.attrs.failReason`:
318
+
319
+ ```javascript
320
+ agenda.on('fail', async (err, job) => {
321
+ await saveJobError({
322
+ jobId: job.attrs._id,
323
+ jobName: job.attrs.name,
324
+ message: err.message,
325
+ stack: err.stack
326
+ });
327
+ });
328
+ ```
329
+
316
330
  ## Custom Backend
317
331
 
318
332
  For databases other than MongoDB, PostgreSQL, or Redis, implement `AgendaBackend`:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agenda",
3
- "version": "6.2.4",
3
+ "version": "6.2.5",
4
4
  "description": "Light weight job scheduler for Node.js",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",