Error handling classes and patterns for the Agentforce Android SDK.
Error Classes
- AgentforceSDKError - SDK error types and exceptions
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:
try {
val client = AgentforceClient()
// SDK operations
} catch (error: AgentforceSDKError) {
when (error) {
is AgentforceSDKError.NoAgentConfigured -> {
// Handle configuration error
}
is AgentforceSDKError.UnableToStartASession -> {
// Handle session error
}
}
}
Related Documentation
- AgentforceClient - Main client class that may throw errors
- AgentforceConversation - Conversation management with error handling