From 13c5f633b324d43f8ba4cfeeeca8c8f93e5fa845 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 31 Jan 2026 11:36:59 +0000 Subject: [PATCH] fix: Use user-friendly error message in API key login catch block Log the technical exception details via LogService.instance.error and show a generic "Unable to connect" message to the user instead of exposing the raw exception string. https://claude.ai/code/session_01DnyCzdMjVpSsbBZK3XbzUH --- mobile/lib/providers/auth_provider.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mobile/lib/providers/auth_provider.dart b/mobile/lib/providers/auth_provider.dart index 92ec8cf61..bfc24670f 100644 --- a/mobile/lib/providers/auth_provider.dart +++ b/mobile/lib/providers/auth_provider.dart @@ -164,8 +164,9 @@ class AuthProvider with ChangeNotifier { notifyListeners(); return false; } - } catch (e) { - _errorMessage = 'Connection error: ${e.toString()}'; + } catch (e, stackTrace) { + LogService.instance.error('AuthProvider', 'API key login error: $e\n$stackTrace'); + _errorMessage = 'Unable to connect. Please check your network and try again.'; _isLoading = false; notifyListeners(); return false;