Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Salesforce reports errors in Flows and Processes by sending error emails. These are routed to the same email handler as Apex Exception reports, however the format is very different.
We use the
fromName
property to detect which email type is being handled, and route to the correct parser class.Flow and Process emails do not contain stack traces or a code-level error location. Rather they contain a list of log entries of the user actions leading up to the error, as well as metadata about the state of the Flow at the time of the error. This fits well with the way telemetry is used in Rollbar occurrences, and so these are converted to a list of telemetry events in the payload, with type='log'.
The log entries in the email body are generally unstructured text. There are always one or more lines of whitespace between each, so these newlines are the marker used to separate each message into a separate telemetry event.
While the Exception emails use only the plain text part of the email body, the Flow/Process emails use only the html part. On inspection, the html is not reliably valid, however tag stripping can be performed reliably. The body is tag stripped, and then treated as plain text.
The email title contains the description of the error itself, and this is used as the error message in the occurrence.