await/async error handling pattern

32 views
Skip to first unread message

Bruce Mcpherson

unread,
Jul 15, 2019, 12:31:19 PM7/15/19
to Google Apps Script Community
We're still not there on Apps Script, but many of you will be using a more mdern JavaScript dialect in your htmlservice scripts, or perhaps in conjunction with Clasp.

Here's a small tip to remove something that was putting me off using async/await - maybe you too.
Putting try/catch around stuff again seems messy. So what to do ?

https://github.com/brucemcpherson/desktopliberation/issues/20

Steven Bazyl

unread,
Jul 15, 2019, 12:57:54 PM7/15/19
to google-apps-sc...@googlegroups.com
Yep, this pattern has been around for a while :) See https://www.npmjs.com/package/await-to-js


--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-script-community.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/b4ea3745-9d9e-411a-a567-78cdb5f37d08%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bruce Mcpherson

unread,
Jul 15, 2019, 5:37:00 PM7/15/19
to google-apps-sc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages