#How to debug code in promises not getting called?

1 messages · Page 1 of 1 (latest)

rich ore
#

I have a piece of code like this:

let result =
  promise.try_await(some_async_fn(), fn(data) {
    io.println("this is never printed")
    promise.resolve(Ok(Nil))
  })
io.println(string.inspect(result)) // this prints js(Promise {})

how do I debug this println not getting called? lucydebugfail I don't see any way to check the promise state either

pine rune
#

You can write panic as "Your text", this should blow up the promise if it is executed for sure

rich ore
#

hmm it finished executing without panicking lucydebugfail I need to minimize this

nova egret
#

if the promise does not resolve, your code is not run