문제

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?

도움이 되었습니까?

해결책

It should be Q.fcall(foo, input)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top