Hi, has anyone successfully used promise.all() in ...
# suitescript
m
Hi, has anyone successfully used promise.all() in SS2.1 with N/https? The goal is to dynamically make N number of requests asynchronously. Sample use case: paginated search results. The goal is to call for all pages of the search at once to optimize performance
b
general rule of Promises is to have a clear error handling strategy
there is no global Promise rejection mechanism
and NetSuite's standard error emailing functionality wont work
and dont just leave it at logs, those tend to be too temporary for serious use
m
Thanks for the tips. Do you have a code sample of promise.all()?
b
generally i wont bother without knowing what your attempt looked like
honestly Promise.All sounds like a pain for what you are trying, you would probably end up needing a recursive catch to prevent an error on one request ruining the rest