Created
October 4, 2010 19:10
-
-
Save dvv/610255 to your computer and use it in GitHub Desktop.
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
w = (func, cb, args) -> | |
errHandler = (err) -> | |
dir 'ERR', err | |
try | |
promise.when func.apply(this, args), cb, errHandler | |
catch err | |
errHandler err | |
w1 = (func, cb, args) -> | |
errHandler = (err) -> | |
if err not instanceof Error | |
err = new Error err # TODO: check err type | |
cb err | |
try | |
promise.when func.apply(this, args), cb, errHandler | |
catch err | |
errHandler err | |
w2 = (func, cb, eb, args) -> | |
try | |
promise.when func.apply(this, args), cb, eb | |
catch err | |
eb err |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment