mirror of
https://github.com/we-promise/sure.git
synced 2026-04-07 14:31:25 +00:00
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
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user