Turns out `error.SuiteScriptError instanceof Error...
# suitescript
j
Turns out
error.SuiteScriptError instanceof Error
is
false
First time this has bitten me Thought I'd share: while debugging I found this snippet from the source code of
N/error
Copy code
//inheritance TODO this is not working for Error, SuiteScriptError is not an instanceof Error
var debuggable = nsobject.getNewInstance();
var err = Object.create(Error.prototype);
debuggable.prototype = err;
SuiteScriptError.prototype = debuggable;
SuiteScriptError.prototype.constructor = SuiteScriptError;