]> git.ktnx.net Git - mobile-ledger.git/commitdiff
for some reason, on bad http auth data the stack throws NotFoundException
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sat, 8 Dec 2018 17:21:56 +0000 (17:21 +0000)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sat, 8 Dec 2018 17:21:56 +0000 (17:21 +0000)
app/src/main/java/net/ktnx/mobileledger/RetrieveAccountsTask.java
app/src/main/res/values/strings.xml

index d90eda15dabe74349e46bfddc1f8b3598c7190e9..1beb048ac648f2504cfca6a906a1f97633f23b66 100644 (file)
@@ -4,6 +4,7 @@ import android.content.SharedPreferences;
 import android.util.Log;
 
 import java.io.BufferedReader;
+import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
@@ -130,7 +131,12 @@ abstract public class RetrieveAccountsTask extends android.os.AsyncTask<Void, In
         } catch (MalformedURLException e) {
             error = R.string.err_bad_backend_url;
             e.printStackTrace();
-        } catch (IOException e) {
+        }
+        catch (FileNotFoundException e) {
+            error = R.string.err_bad_auth;
+            e.printStackTrace();
+        }
+        catch (IOException e) {
             error = R.string.err_net_io_error;
             e.printStackTrace();
         }
index d15a1134cd93ec61184fb4e5cf43a7b6aaf13077..ad43d6a2bc43973cd0d1642e27036fdb91f58653 100644 (file)
@@ -73,4 +73,5 @@
     <string name="menu_hide_acc_title">Hide account</string>
     <string name="menu_hide_acc_condensed_title">Hide</string>
     <string name="menu_acc_summary_show_hidden_accounts_title">Show hidden accounts</string>
+    <string name="err_bad_auth">Invalid username or password</string>
 </resources>