Skip to main content

Your First Error

Set up error tracking with Reflex.

Automatic Capture

Once the SDK is installed, errors are captured automatically:
def show
  @user = User.find(params[:id])  # RecordNotFound is captured
end

Manual Capture

Capture errors while handling them gracefully:
begin
  process_payment(order)
rescue PaymentError => e
  BrainzLab::Reflex.capture(e)
  flash[:error] = "Payment failed. Please try again."
  redirect_to checkout_path
end

Add Context

BrainzLab::Reflex.capture(exception,
  user: { id: current_user.id, email: current_user.email },
  tags: { feature: "checkout" },
  extra: { order_id: order.id, amount: order.total }
)

Capture Messages

For error-like events without exceptions:
BrainzLab::Reflex.capture_message("Unexpected state",
  level: :warning,
  extra: { state: object.state }
)

View in Dashboard

  1. Go to brainzlab.ai/dashboard
  2. Click “Reflex” in the sidebar
  3. See your errors grouped and sorted

Set Up Alerts

  1. Go to Settings > Notifications
  2. Connect Slack or add email
  3. Get notified when errors occur

Next Steps