Comparing version 0.4.0 to 0.4.1
@@ -142,3 +142,3 @@ var util = require('util'); | ||
} catch(e){ | ||
throw new FlowTaskError(self.name, "Error during execution of function.", e); | ||
return callback(new FlowTaskError(self.name, "Error during execution of function.", e)); | ||
} | ||
@@ -145,0 +145,0 @@ }); |
@@ -6,3 +6,3 @@ { | ||
"author": "David Fenster <david@dfenster.com>", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"repository": { | ||
@@ -9,0 +9,0 @@ "type": "git", |
@@ -549,21 +549,31 @@ var us = require('underscore'); | ||
module.exports["error in task function"] = function(test){ | ||
try { | ||
new Flow({ | ||
getBook: new Task(Book.getById, 'bookId'), | ||
getAuthor: new Task(Author.getById), | ||
new Flow({ | ||
getBook: new Task(Book.getById, 'bookId'), | ||
getAuthor: new Task(Author.getById), | ||
}).execute({ | ||
bookId: 1 | ||
}, function(err, results){ | ||
test.fail(null, null, "no error received"); | ||
test.done(); | ||
}); | ||
} catch(e) { | ||
test.ok(e, 'got an error'); | ||
test.equals(e.name, "FlowTaskError", "got FlowTaskError"); | ||
test.equals(e.message, "Flow error in 'getAuthor': Error during execution of function.", "error message match") | ||
test.ok(/TypeError: undefined is not a function/.test(e.stack)) | ||
bookId: 1 | ||
}, function(err, results){ | ||
test.ok(err, 'got an error'); | ||
test.equals(err.name, "FlowTaskError", "got FlowTaskError"); | ||
test.equals(err.message, "Flow error in 'getAuthor': Error during execution of function.", "error message match") | ||
test.ok(/TypeError: undefined is not a function/.test(err.stack)) | ||
test.done(); | ||
} | ||
}); | ||
} | ||
module.exports["error in synchronous task function"] = function(test){ | ||
new Flow({ | ||
getBook: new Task(Book.getById, 'bookId'), | ||
getAuthor: new Fn(Author.getById), | ||
}).execute({ | ||
bookId: 1 | ||
}, function(err, results){ | ||
test.ok(err, 'got an error'); | ||
test.equals(err.name, "FlowTaskError", "got FlowTaskError"); | ||
test.equals(err.message, "Flow error in 'getAuthor': Error during execution of function.", "error message match") | ||
test.ok(/TypeError: undefined is not a function/.test(err.stack)) | ||
test.done(); | ||
}); | ||
} | ||
module.exports["subFlow execution"] = function(test){ | ||
@@ -570,0 +580,0 @@ new Flow({ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
111185
1803