darrenhillconsulting
01/03/2025, 10:24 PMthrow
an error in the map stage, so that I can process that error in the summary stage. I'd like to include to 'information' in the error for a better reporting experience in the summary stage. However, all I'm able to observe in the mapSummary.errors
"{"type":"error.SuiteScriptError","name":"UNEXPECTED_ERROR","message":"Unexpected Error"}"
No matter if I throw a error.create(), or a new Error().
Anyone here have success throwing data-rich errors in a map/reduce?Anthony OConnor
01/03/2025, 10:27 PMdarrenhillconsulting
01/03/2025, 10:28 PMAnthony OConnor
01/03/2025, 10:30 PMdarrenhillconsulting
01/03/2025, 10:31 PMAnthony OConnor
01/03/2025, 10:31 PMerictgrubaugh
01/03/2025, 10:35 PMerror.create
as additional parameters. The extra data will be accessible under the cause
property of the resulting Error
instance:erictgrubaugh
01/03/2025, 10:36 PMbattk
01/04/2025, 8:03 AMbattk
01/04/2025, 8:04 AMdarrenhillconsulting
01/04/2025, 3:37 PMMarvin
01/10/2025, 2:29 PMmessage
parameter I didn't know you could add other parameters that get stuffed into cause
. I don't see that documented is it uniform across all script types and what is the benefit over utilizing message
? https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_158049399342.htmlerictgrubaugh
01/10/2025, 3:21 PMerror.create
method on the client side. I'd be a little surprised if this implementation varied across script types, but it could.
The benefit is that message
is a string
while cause
is an object
. You don't have to serialize then de-serialize your data using cause
, but you do using message
.