summaryrefslogtreecommitdiff
path: root/lib/asyncify.js
diff options
context:
space:
mode:
authorRay Myers <raydog87@gmail.com>2016-06-22 18:24:00 -0700
committerHubert Argasinski <argasinski.hubert@gmail.com>2016-06-29 18:38:51 -0400
commitf2cd951d15326de4a585b264d57189658109f757 (patch)
tree5767f8fcff3ebce7a13c6df1cd4ab7cbf86ceec1 /lib/asyncify.js
parented6efaa6429e7d9977d3962f175b56a8cdc30ab3 (diff)
downloadasync-f2cd951d15326de4a585b264d57189658109f757.tar.gz
Fixed callback being able to be called twice in asyncify
Diffstat (limited to 'lib/asyncify.js')
-rw-r--r--lib/asyncify.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/asyncify.js b/lib/asyncify.js
index e235311..dec39d2 100644
--- a/lib/asyncify.js
+++ b/lib/asyncify.js
@@ -68,7 +68,7 @@ export default function asyncify(func) {
if (isObject(result) && typeof result.then === 'function') {
result.then(function(value) {
callback(null, value);
- })['catch'](function(err) {
+ }, function(err) {
callback(err.message ? err : new Error(err));
});
} else {