I want to show the custom error message with out stack trace to user using "suitescript 2.0"version. In workflow the custom error message is showing without stack trace but in Suite Script the "ERROR MESSAGE " is showing with the stack trace.
ERROR WITH STACK TRACE: {"type":"error.SuiteScriptError","name":"MISSING_CONTRACT_LINE","message":"Please enter atleast one Contract Line item to save a contract.","stack":["createError(N/error)","beforeSubmit(SuiteScripts/Ex_UE_Contract_2.0.js:117)","createError(N/error)"],"cause":{"name":"MISSING_CONTRACT_LINE","message":"Please enter atleast one Contract Line item to save a contract."},"id":""}
I want to show the custom error message without stack trace like this: "name":"MISSING_CONTRACT_LINE","message":"Please enter atleast one Contract Line item to save a contract."
my Code:
throw error.create({
name: 'MISSING_CONTRACT_LINE',
message: 'Please enter atleast one Contract Line item to save a contract.'
});
is there any possible way to achieve this?
thanks in advance.