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

You 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:

from sym.sdk.notifications import Notification
from sym.sdk.integrations import slack

def get_request_notifications(event):
  Post to shared channel to ask for access approval
  fvars = event.flow.vars
  # Who's the requester?
  print(f"Requester: {event.user}")
  # What's my tfvars config?
  print(f"fvars: {fvars}")
  return [Notification(destinations=[slack.channel("#request_channel")])]

Will result in this output being sent to the Implementer: