How can I avoid netsuite displaying a stack trace while throwing an error created with N/error?
s
stalbert
06/08/2021, 6:52 PM
catch the error and manipulate as desired?
a
Alan Fitch
06/08/2021, 6:54 PM
I need to prevent the record from being submitted.
Alan Fitch
06/08/2021, 6:54 PM
At all costs.
s
scottvonduhn
06/08/2021, 7:01 PM
I assume @stalbert meant catching the error, then modifying it to remove the stacktrace ( setting it to null, etc. ) then re-throwing the modified error. If that doesn’t work (the stacktrace can’t be modified or removed), then just create and throw a new custom error yourself.
a
Alan Fitch
06/08/2021, 7:04 PM
Ah now I get it.
s
stalbert
06/08/2021, 7:31 PM
Yes, if you can provide a more meaningful error message for the users that will be much better than the default NS serialization of an error object with the stack trace and other garbage to confuse an end user.