Unknown host exception because of VPN

pull/214/head
M66B 1 year ago
parent e2db6d9943
commit 6c2b2ae45a

@ -612,7 +612,7 @@ public class EmailService implements AutoCloseable {
} catch (UnknownHostException ex) { } catch (UnknownHostException ex) {
String last = prefs.getString(key, null); String last = prefs.getString(key, null);
if (TextUtils.isEmpty(last)) if (TextUtils.isEmpty(last))
throw new MessagingException(ex.getMessage(), ex); throw ex;
else { else {
EntityLog.log(context, EntityLog.Type.Network, "Using " + key + "=" + last); EntityLog.log(context, EntityLog.Type.Network, "Using " + key + "=" + last);
main = InetAddress.getByName(last); main = InetAddress.getByName(last);
@ -641,6 +641,10 @@ public class EmailService implements AutoCloseable {
} catch (UnknownHostException ex) { } catch (UnknownHostException ex) {
crumb.put("exception", ex + "\n" + android.util.Log.getStackTraceString(ex)); crumb.put("exception", ex + "\n" + android.util.Log.getStackTraceString(ex));
Log.breadcrumb("Connection failed", crumb); Log.breadcrumb("Connection failed", crumb);
if (ConnectionHelper.vpnActive(context))
throw new MessagingException(ex.getMessage(),
new Exception(context.getString(R.string.title_service_vpn), ex));
else
throw new MessagingException(ex.getMessage(), ex); throw new MessagingException(ex.getMessage(), ex);
} catch (MessagingException ex) { } catch (MessagingException ex) {
crumb.put("exception", ex + "\n" + android.util.Log.getStackTraceString(ex)); crumb.put("exception", ex + "\n" + android.util.Log.getStackTraceString(ex));

Loading…
Cancel
Save