Has anyone successfully used async/await with SS2....
# suitescript
e
Has anyone successfully used async/await with SS2.1 yet?
b
i wouldnt use them in production
you can theoretically get them to work with the promise version of some suitescript apis
but there is no global error event handler for promises
any error thrown is ignored
1000 1
c
I spent quite awhile trying to get it working. Had to abandon it due to errors not bubbling up correctly.
Another issue is that entry points aren’t async compatible. This might not be a yuge deal, but w/o the ability to
await
somewhere you must resort to the IIFE
(async () => { … do stuff … })();
, which seems hacky or do a
Promise.resolve()
which seems less hacky, but again, if any errors happen in your `await`’s you’ll never be notified.
b
you can use the implicit promise returned by the async function to log the error, but you cant do the normal thing of stopping execution from the error
m
I saw a presentation at NetSuite Now On Air, apparently there is work on progress for full support.
💯 1