summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Myers <raydog87@gmail.com>2016-06-22 18:24:00 -0700
committerRay Myers <raydog87@gmail.com>2016-06-22 18:24:00 -0700
commit066c3f193b36e8430c23762889306b9d6e0adf5c (patch)
treecc510130fcec529afa37554c4e8b29c87366af96
parent1706048929a1882c0ee7391065616b15dd9fd621 (diff)
downloadasync-066c3f193b36e8430c23762889306b9d6e0adf5c.tar.gz
Fixed callback being able to be called twice in asyncify
-rw-r--r--lib/asyncify.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/asyncify.js b/lib/asyncify.js
index e3f6f87..089f94b 100644
--- a/lib/asyncify.js
+++ b/lib/asyncify.js
@@ -67,7 +67,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 {