Skip to main content
Muta will automatically handle errors and prevent the flow from displaying if there are any issues. You can listen for these errors to show appropriate messages to your users.

Example Usage

Error Types

1. Network Errors

  • Emitted when there’s no internet connection
  • The flow will not display
  • You should show an appropriate “No internet connection” message

2. Placement Errors

  • Emitted when there’s an issue with the placement ID or API key
  • The flow will not display
  • You should show an appropriate error message to the user

Error Event Structure

Network Error

Placement Error

Best Practices

  1. User-Friendly Messages: Display error messages that are clear and actionable for users.
  2. Error Recovery: Implement retry mechanisms for network errors.
  3. Error Logging: Log errors for debugging and monitoring purposes.
  4. Fallback Content: Provide fallback content or alternative flows when errors occur.
  5. Error Prevention: Validate placement IDs and API keys before attempting to display flows.

Example Implementation

Error Codes

Network Errors

  • NETWORK_ERROR: General network connectivity issues
  • TIMEOUT_ERROR: Request timeout
  • OFFLINE_ERROR: Device is offline

Placement Errors

  • INVALID_PLACEMENT_ID: The provided placement ID is invalid or doesn’t exist
  • INVALID_API_KEY: The API key is invalid or has been revoked
  • PLACEMENT_NOT_FOUND: The placement could not be found
  • PLACEMENT_DISABLED: The placement has been disabled
  • PLACEMENT_EXPIRED: The placement has expired