diff options
author | Ray Myers <raydog87@gmail.com> | 2016-06-22 18:24:00 -0700 |
---|---|---|
committer | Ray Myers <raydog87@gmail.com> | 2016-06-22 18:24:00 -0700 |
commit | 066c3f193b36e8430c23762889306b9d6e0adf5c (patch) | |
tree | cc510130fcec529afa37554c4e8b29c87366af96 | |
parent | 1706048929a1882c0ee7391065616b15dd9fd621 (diff) | |
download | async-066c3f193b36e8430c23762889306b9d6e0adf5c.tar.gz |
Fixed callback being able to be called twice in asyncify
-rw-r--r-- | lib/asyncify.js | 2 |
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 { |