SOLVED: Was beating my head against a wall why the...
# suitescript
d
SOLVED: Was beating my head against a wall why the GET request to my RESTlet was throwing
An 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?
full error (in case someone else ends up needing this info):
{
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."
}