Created
February 17, 2015 21:54
-
-
Save iarna/938882a5bcb195cc8425 to your computer and use it in GitHub Desktop.
example
This file contains hidden or 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 thingy(cb) | |
doAsyncThing("arg1", "arg2", "argn", andWarnOnError(log, cb)) | |
} | |
function andWarnOnError (log, cb) { | |
return function (er, result) { | |
if (er) { | |
log.warn("install", "Couldn't install optional dependency:", er.message) | |
log.verbose("install", er.stack) | |
} | |
cb(null, result) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment