Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

agenda

Package Overview
Dependencies
Maintainers
1
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

agenda - npm Package Compare versions

Comparing version 0.5.1 to 0.5.2

5

History.md
0.5.2 / 2014-01-06
==================
* Added ability for job.fail to take an error
0.5.1 / 2013-01-04 (Backwards compatible!)

@@ -3,0 +8,0 @@ ==================

5

lib/job.js

@@ -81,2 +81,5 @@ var humanInterval = require('human-interval'),

Job.prototype.fail = function(reason) {
if(reason instanceof Error) {
reason = reason.message;
}
this.attrs.failReason = reason;

@@ -99,3 +102,3 @@ this.attrs.failedAt = new Date();

if(err){
self.fail(err.message);
self.fail(err);
agenda.emit('fail', err, self);

@@ -102,0 +105,0 @@ agenda.emit('fail:' + self.attrs.name, err, self);

2

package.json
{
"name": "agenda",
"version": "0.5.1",
"version": "0.5.2",
"description": "Light weight job scheduler for Node.js",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -336,4 +336,9 @@ # Agenda

Optionally, `reason` can be an error, in which case `job.attrs.failReason` will
be set to `error.message`
```js
job.fail('insuficient disk space');
// or
job.fail(new Error('insufficient disk space'));
job.save();

@@ -340,0 +345,0 @@ ```

@@ -308,6 +308,10 @@ var mongoCfg = 'localhost:27017/agenda-test',

var job = new Job();
it('sets the fail reason', function() {
it('takes a string', function() {
job.fail('test');
expect(job.attrs.failReason).to.be('test');
});
it('takes an error object', function() {
job.fail(new Error('test'));
expect(job.attrs.failReason).to.be('test');
});
it('sets the failedAt time', function() {

@@ -314,0 +318,0 @@ job.fail('test');

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc