I am using a try - catch and trapping an error. When I get the error, I want to write it to the trace log. I am able to write to the log. There is a property in the System.Exception called “InnerMessages” that is an array of the actual errors that caused the exception.
Here is a print screen of the InnerMessages that shows the details I want to write to the log:
I write to the log with PXTrace.WriteError(ex);
This is the only thing that shows in the Trace screen. It just shows the basic message and the place in my code where the error occurred.
My thought is that I could cycle through the InnerMessages array and write it to the trace log so if my customer has an error, I can actually know what it is.
Does anyone know how I can access the InnerMessages property? I cannot find any way to do it.
Best answer by Joe Schmucker
View original