From a3a0c0a15d9b550642f25b27713a01436786671d Mon Sep 17 00:00:00 2001 From: Peter Serwylo Date: Tue, 1 Aug 2017 13:04:04 +1000 Subject: [PATCH] More verbose logging There are some ACRA reports with this IllegalStateException getting hit. It used to be that it was only ever because we forgot to request the correct fields from the database. However now I'm not sure that this is the only source. Perhaps it is also possible in response to parcelling apk instances, or maybe something else? Either way, this should provide further info about whether the apk doesn't belong to a repo for some reason. --- app/src/main/java/org/fdroid/fdroid/data/Apk.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/fdroid/fdroid/data/Apk.java b/app/src/main/java/org/fdroid/fdroid/data/Apk.java index 0668c8663..6fc5ac197 100644 --- a/app/src/main/java/org/fdroid/fdroid/data/Apk.java +++ b/app/src/main/java/org/fdroid/fdroid/data/Apk.java @@ -250,8 +250,10 @@ public class Apk extends ValueObject implements Comparable, Parcelable { private void checkRepoAddress() { if (repoAddress == null || apkName == null) { - throw new IllegalStateException("Apk needs to have both Schema.ApkTable.Cols.REPO_ADDRESS and " - + "Schema.ApkTable.Cols.NAME set in order to calculate URL."); + throw new IllegalStateException( + "Apk needs to have both Schema.ApkTable.Cols.REPO_ADDRESS and " + + "Schema.ApkTable.Cols.NAME set in order to calculate URL " + + "[package: " + packageName + ", versionCode: " + versionCode + ", repoId: " + repoId + "]"); } }