It should be Q.fcall(foo, input)
Error handling with Q promise
-
15-07-2023 - |
题
So, I have the following code
Q.fcall(foo(input))
.then(
() ->
# do stuff
)
.fail(
# this never gets called
)
foo = (input) ->
throw new Error('catch me!')
And I get the following error: Uncaught Error: catch me!
. Per the docs The .fail
call should catch any errors thrown by foo
- Am I doing something wrong?
解决方案
不隶属于 StackOverflow