System Error Handling
How technical information is differentiated from user-facing messaging to ensure clarity and actionable feedback.
The Pipeline Philosophy
Technical information stays in dev logs. Plain English reaches the user.
graph LR
Exception[Exception Caught] -->|Map & Filter| Log[Dev Log: Raw Details]
Log -->|Replace Technical Terms| UserMsg[User Message: Plain English]
UserMsg -->|Reactive Stream| UI[Display in Error Box]
Common Scenarios
| Situation | User-Facing Message |
|---|---|
| ADB not found | ADB runtime not found. Please reinstall the application. |
| Push unsuccessful | Could not transfer service to device. Check connection. |
| Handshake timeout | Background service timed out. Device may be unreachable. |
| APK install fail | Check device storage and USB permissions. |
| Device disconnected | Check your USB cable or Wi-Fi connection. |
Connection Failure Heuristics
The system distinguishes between environment errors (like missing files) and connection errors. For connection errors, a specialized recovery button appears to trigger the device selection interface.
bool _isConnectionError(String msg) {
final l = msg.toLowerCase();
return l.contains('connect') || l.contains('device') ||
l.contains('adb') || l.contains('network') ||
l.contains('refused') || l.contains('timeout');
}