function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Phil Rowlinson 6Phil Rowlinson 6 

Can someone give advice on how to best diagnose a process builder error when running a test class

I'm building out a test class and receiving a process builder error. The process builder has many nodes, and should probably be split up, I'm having trouble identifying the unhandled fault. I know that the error is becuase some data is missing in the test class. In regular use, the person activating the process builder gets and error log, but in a test class, nothing is sent. The debug log is incredibly hard to read which node in the PB is failing. I am hoping there is an easy way to do this.
Gaurav HandooGaurav Handoo
Hi Phil

I believe whenever there is a failure of Process Builder, there is an error log that is sent over to the admin's email address. You can use this log to debug which step has failed.

Hope this helps. Please mark as best answer if it does.

Cheers!!
Gaurav
Phil Rowlinson 6Phil Rowlinson 6
Thank you for the reply. Yes it does send an email, when running as a user. For some reason the test class is not triggering the email debug. The email that you mention is incredibly helpful. I did manage to work my way through the debug logs eventually to find the error. Knowing the text to searh for is the key thing, and that you can find in the test result message.