Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
Hi,
I want to all of the service use a unified way of raise error message , so the the service will call the wrapped service like RaiseError service instead of javascript statement "throw new error" when raising error.
The problem is that you can only find the line number of RaiseError service in the application log for any service while I need the original position where RaiseError is called .
So can I get the call stack with information of line number so that I can log a more specified error info ?
Regards,
Sean
Solved! Go to Solution.
@seanccc ,
The JavaScript Error object has lineNumber and stack that you can access in your catch statement:
try{
//some code here
}
catch(err) {
logger.warn(err.lineNumber + " " + err.stack);
}
@seanccc ,
The JavaScript Error object has lineNumber and stack that you can access in your catch statement:
try{
//some code here
}
catch(err) {
logger.warn(err.lineNumber + " " + err.stack);
}