TIL a fun trick. Using the `N/error` module, you c...
# suitescript
e
TIL a fun trick. Using the
N/error
module, you can augment the thrown
SuiteScriptError
Object with any properties you want, and then retrieve them later via the
cause
Object of the error. For some context, I'm doing this in a Map/Reduce script via the Summary stage's error iterators, so I can't vouch for other contexts/script types at this time.
m
Interesting trick. Though would you use this in production code, considering it's not officially documented?
e
Probably, yes, because in this specific use case it's very low risk if it stops working.
👍 1
In the general case, no, I do not use undocumented functionality.