Handling Errors & Troubleshooting
Use Slack to surface errors and log SDK output
Configuring an Errors Channel
You can configure error channels for your Flows, so that you get notified right in Slack when one of your users hits an issue.
# The sym_environment is a container for sym_flows that share configuration values
# (e.g. shared integrations or error logging)
resource "sym_environment" "this" {
name = "main"
error_logger_id = sym_error_logger.slack.id
...
}
# This sym_error_logger will output any warnings and errors that occur during
# execution of a sym_flow to a specified channel in Slack.
resource "sym_error_logger" "slack" {
integration_id = sym_integration.slack.id
destination = "#sym-errors"
}
Error Notifications
Once you've got your errors channel configured, we'll let you know if a user hits a problem when using a Sym Flow:

Errors from the SDK
As you are authoring flows, Sym will DM you when your Python implementation code has an error:

Using print
statements
print
statementsYou can troubleshoot your implementations with print()
statements!
Anything you print()
in your SDK implementation will be sent in Slack to the user who initiated the flow, making it much easier to troubleshoot your code as it runs in our environment.
These print statements:
@reducer
def get_approvers(evt):
"""
Post to shared channel to ask for access approval
"""
fvars = evt.flow.vars
# Who's the requester?
print(f"Requester: {evt.user}")
# What's my tfvars config?
print(f"fvars: {fvars}")
return slack.channel(fvars["request_channel"], allow_self=True)
Will result in this output being sent to the Implementer:
Updated 3 days ago