Pregunta

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?

¿Fue útil?

Solución

It should be Q.fcall(foo, input)

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top