Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flow and Process error reports #17

Merged
merged 1 commit into from
May 29, 2020

Conversation

waltjones
Copy link
Contributor

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.

@waltjones waltjones force-pushed the wj-flow-and-process-error-reports branch from 4ba547b to cca2b54 Compare May 28, 2020 22:13
@waltjones waltjones requested a review from austenLacy May 29, 2020 16:23
Copy link

@austenLacy austenLacy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Nice work @waltjones!

@waltjones waltjones merged commit 7c48124 into master May 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants