Printing the stacktrace of an exception to the log
When you code your error Hooks then you generally don't get the exception stacktrace printed, as you do when the error halts your AL. Here is some handy code to do this yourself:
// Error Hook code - the error Entry will be available var sw = java.io.StringWriter(); var pw = java.io.PrintWriter(sw); error.exception.printStackTrace(pw); pw.close(); task.logmsg("Stacktrace: \n" + sw)
No comments:
Post a Comment