Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 05aec6b6 authored by Fs00's avatar Fs00
Browse files

Further improve download error messages

parent d2b18178
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -63,13 +63,13 @@ public class DownloadPDFFile extends AsyncTask<String, Void, Object> {
        if (activity != null) {
        if (activity != null) {
            // Manage error
            // Manage error
            if (result == null) {
            if (result == null) {
                Toast.makeText(activity, R.string.toast_io_exception, Toast.LENGTH_SHORT).show();
                Toast.makeText(activity, R.string.toast_generic_download_error, Toast.LENGTH_LONG).show();
            } else if (result instanceof Integer) {
            } else if (result instanceof Integer) {
                Toast.makeText(activity, R.string.toast_http_code_error, Toast.LENGTH_SHORT).show();
                Toast.makeText(activity, R.string.toast_http_code_error, Toast.LENGTH_LONG).show();
            } else if (result instanceof SSLException) {
            } else if (result instanceof SSLException) {
                Toast.makeText(activity, R.string.toast_ssl_error, Toast.LENGTH_SHORT).show();
                Toast.makeText(activity, R.string.toast_ssl_error, Toast.LENGTH_LONG).show();
            } else if (result instanceof IOException) {
            } else if (result instanceof IOException) {
                Toast.makeText(activity, R.string.toast_io_exception, Toast.LENGTH_SHORT).show();
                Toast.makeText(activity, R.string.toast_generic_download_error, Toast.LENGTH_LONG).show();
            } else if (result instanceof File) {
            } else if (result instanceof File) {
                activity.saveFileAndDisplay((File) result);
                activity.saveFileAndDisplay((File) result);
            }
            }
+1 −1
Original line number Original line Diff line number Diff line
@@ -27,7 +27,7 @@
    <string name="pick_file">Pick File</string>
    <string name="pick_file">Pick File</string>
    <string name="toast_pick_file_error">Unable to pick file. Check status of file manager.</string>
    <string name="toast_pick_file_error">Unable to pick file. Check status of file manager.</string>
    <string name="toast_http_code_error">Remote server responded with an error.</string>
    <string name="toast_http_code_error">Remote server responded with an error.</string>
    <string name="toast_io_exception">We can\'t load this page for some reason.</string>
    <string name="toast_generic_download_error">We couldn\'t download this file for some reason.</string>
    <string name="toast_ssl_error">Secure connection failed.</string>
    <string name="toast_ssl_error">Secure connection failed.</string>
    <string name="action_about">About</string>
    <string name="action_about">About</string>
    <string name="version">Version</string>
    <string name="version">Version</string>