Last active
August 12, 2018 16:12
-
-
Save peterli888/a11a2e7e592bae04ef1e47499a291a40 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function awaitall(promise) { | |
//这个能捕捉错误 | |
return promise.then(data => { | |
return [null, data]; | |
}) | |
.catch(err => [err]); | |
} | |
let [err,res]=await awaitall(aysncfn) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment