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
battk
06/03/2022, 3:38 AM
general rule of Promises is to have a clear error handling strategy
battk
06/03/2022, 3:38 AM
there is no global Promise rejection mechanism
battk
06/03/2022, 3:38 AM
and NetSuite's standard error emailing functionality wont work
battk
06/03/2022, 3:38 AM
and dont just leave it at logs, those tend to be too temporary for serious use
m
mykke
06/03/2022, 4:07 AM
Thanks for the tips. Do you have a code sample of promise.all()?
b
battk
06/03/2022, 4:51 AM
generally i wont bother without knowing what your attempt looked like
battk
06/03/2022, 4:52 AM
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