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:
![](https://uploads-us-west-2.insided.com/acumatica-en/attachment/cd608c6d-83d1-46de-bf18-d5cffab0e2e9.png)
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.
![](https://uploads-us-west-2.insided.com/acumatica-en/attachment/aae28c6a-5ab5-4e9c-9420-a03a9428e0b1.png)
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