<@U5H9HECTS> Do you mean in instances where Netsui...
# suitescript
a
@screnshaw Do you mean in instances where Netsuite navigates to a white page with just error text displayed on it?
s
Yeah. When I throw it however, I get an email every time. Then if I use the N/error, it throws the ugly error message
a
Is this for a Suitelet?
s
Nah. for a user event
a
(hopefully) last question: and you want to keep error emailing on for other errors? Or do you just want your User Event to stop sending error emails altogether?
s
Yeah. This particular example is a duplicate item error. We can't attach a client script to a service item, so I'm having to throw an error in the before submit. Because of this particular error, there is no reason to receive an email notifying of an error
a
I have two thoughts on how to handle this.
If this script’s whole purpose is to check for this and throw an error, you could just turn off error reporting within the “Unhandled Errors” section of the script record.
👍🏼 1
If it does other things, though, and you want it to email errors to you for those things, you could catch the error within a try/catch and possibly navigate the user to a suitelet that displays the error.
I don’t remember the functions that handle navigation like that, though…
s
I don't think I realized that I could decide how to handle errors in the unhandled errors section. That's cool.
Yeah, I've been meaning to create a suitelet that handles all errors, but due to demands, I just haven't gotten to that yet
a
There ya go.
s
preciate it man!
a
Suitelet wold be cool, but it’d be time consuming to implement for all scripts.
No problem!
s
I wish NetSuite would allow us to add our own global error handler to handle all errors. Rather redirected or non redirected