jkabot
03/06/2020, 5:15 PMerror.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
//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;