diff --git a/lib/services/user_service.dart b/lib/services/user_service.dart index 842e49d13..001934071 100644 --- a/lib/services/user_service.dart +++ b/lib/services/user_service.dart @@ -117,6 +117,8 @@ class UserService { } } + // getPublicKey returns null value if email id is not + // associated with another ente account Future getPublicKey(String email) async { try { final response = await _enteDio.get( @@ -127,8 +129,10 @@ class UserService { await PublicKeysDB.instance.setKey(PublicKey(email, publicKey)); return publicKey; } on DioError catch (e) { - _logger.info(e); - return null; + if (e.response != null && e.response?.statusCode == 404) { + return null; + } + rethrow; } }