Chris
07/17/2020, 7:06 PMthrow new Error('blah...');
causes a System UNEXPECTED_ERROR 7/17/2020 12:05 pm dsnetsuite test0 An unexpected SuiteScript error has occurred
Is that supposed to happen? Are we not allowed to manually throw errors? This used to cause the script to bubble the error up and we would see the 'blah...'
in the error logs.battk
07/17/2020, 7:22 PMbattk
07/17/2020, 7:24 PMChris
07/17/2020, 7:34 PMChris
07/17/2020, 7:34 PMChris
07/17/2020, 7:35 PMChris
07/17/2020, 7:36 PMthrow
at all without UNEXPECTED_ERROR
Clay Roper
07/17/2020, 7:37 PMthrow
in 2.1 Suitelets, User Events, and RESTlets based on a quick search of our repo. I'll double-check with my teammates, but AFAIK there aren't any issues.Clay Roper
07/17/2020, 7:38 PM~throw error.create( options );~
Sorry, those turned out to be 2.xClay Roper
07/17/2020, 7:41 PMbattk
07/17/2020, 7:49 PMbattk
07/17/2020, 7:50 PMChris
07/17/2020, 8:04 PM@NApiVersion 2.1
to @NApiVersion 2.0
it works as expected.Clay Roper
07/17/2020, 8:10 PMif ( param === 'error' ) {
throw {
code: '500',
message: 'Testing throw'
}
}
which is caught and handled as I expectClay Roper
07/17/2020, 8:12 PMthrow Error('Testing throw')
battk
07/17/2020, 8:29 PMbattk
07/17/2020, 8:31 PM