Android Error Handling Overview

Error handling classes and patterns for the Agentforce Android SDK.

Error Classes 

Error Types 

The Android SDK provides specific error types for different failure scenarios:

  • NoAgentConfigured - When no agent is properly configured
  • UnableToStartASession - When session initialization fails

Usage Patterns 

Error handling in the Android SDK follows standard Java exception patterns:

1try {
2    val client = AgentforceClient()
3    // SDK operations
4} catch (error: AgentforceSDKError) {
5    when (error) {
6        is AgentforceSDKError.NoAgentConfigured -> {
7            // Handle configuration error
8        }
9        is AgentforceSDKError.UnableToStartASession -> {
10            // Handle session error
11        }
12    }
13}

Related Documentation