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

Commit ca37ee17 authored by Fahim Salam Chowdhury's avatar Fahim Salam Chowdhury 👽
Browse files

chore: replace exception.printStackTrace with timber

Some exceptions are logging with printStackTrace. So some exceptions are
not reported to sentry (if enabled) & some low-level unwanted logs are
printed always. Move these logs to Timber.e & Timber.d respectively, so
the logcat is clean by default & sentry can report more useful data.
parents c792a550 9aead170
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -235,7 +235,7 @@ public class AccountUserInfoWorker extends Worker {
            }
        }
        accountManager.setUserData(account, ACCOUNT_DATA_ALIAS_KEY, aliases);
        Timber.d("fetchAliases(): success");
        Timber.d("fetchAliases(): success: %s", ocsResult.isSuccess());

        DavClientProvider.getInstance().saveAccounts(mContext);

+3 −4
Original line number Diff line number Diff line
@@ -80,9 +80,8 @@ public class GetAliasOperation extends RemoteOperation<ArrayList<String>> {
            }

        } catch (Exception e) {
            e.printStackTrace();
            result = new RemoteOperationResult<>(e);
            Timber.tag(GetAliasOperation.class.getSimpleName()).d("Fetching aliases failed");
            Timber.d(e, "Fetching aliases failed");
        } finally {
            if (get != null)
                get.releaseConnection();
@@ -103,7 +102,7 @@ public class GetAliasOperation extends RemoteOperation<ArrayList<String>> {

            result = jsonData.optJSONArray(NODE_ALIASES);
        } catch (JSONException e) {
            e.printStackTrace();
            Timber.e(e);
        }
        return result;
    }
+2 −1
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import java.text.StringCharacterIterator;
import java.util.Locale;

import foundation.e.drive.R;
import timber.log.Timber;

import static foundation.e.drive.utils.AppConstants.MEDIA_SYNC_PROVIDER_AUTHORITY;
import static foundation.e.drive.utils.AppConstants.METERED_NETWORK_ALLOWED_AUTHORITY;
@@ -184,7 +185,7 @@ public abstract class CommonUtils {
            Method get = c.getMethod("get", String.class);
            value = (String) get.invoke(c, prop);
        } catch (Exception e) {
            e.printStackTrace();
            Timber.e(e);
        }
        return value == null ? "" : value;
    }