mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-28 20:06:29 +01:00
Check http response code
This commit is contained in:
@@ -355,6 +355,10 @@ public class EmailProvider {
|
||||
request.setRequestProperty("User-Agent", WebViewEx.getUserAgent(context));
|
||||
request.connect();
|
||||
|
||||
int status = request.getResponseCode();
|
||||
if (status != HttpURLConnection.HTTP_OK)
|
||||
throw new FileNotFoundException("Error " + status + ":" + request.getResponseMessage());
|
||||
|
||||
// https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser
|
||||
XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
|
||||
XmlPullParser xml = factory.newPullParser();
|
||||
|
||||
Reference in New Issue
Block a user