David B
03/02/2022, 2:31 AMAn unexpected SuiteScript error has occurred
when I tried to searchObject.run()
That was until I wrapped the whole thing in a try-catch and just straight up logged the error to find out the token role was missing the permission "Find Transaction" (full error in thread).
Why would the original error be "unexpected error" and not "INSUFFICIENT_PERMISSION"? Am I missing something here?David B
03/02/2022, 2:32 AM{
type: "error.SuiteScriptError",
name: "INSUFFICIENT_PERMISSION",
message: "Permission Violation: You need the 'Transactions -> Find Transaction' permission to access this page. Please contact your account administrator."
}