Merge pull request #554 from whym/license-exception

Show failed value on license-related RuntimeException
This commit is contained in:
addshore 2017-05-12 15:23:53 +02:00 committed by GitHub
commit d1a395689a

View file

@ -217,7 +217,7 @@ public class Utils {
} else if (license.equals(Prefs.Licenses.CC_BY_SA)) { } else if (license.equals(Prefs.Licenses.CC_BY_SA)) {
return "{{self|cc-by-sa-3.0}}"; return "{{self|cc-by-sa-3.0}}";
} }
throw new RuntimeException("Unrecognized license value"); throw new RuntimeException("Unrecognized license value: " + license);
} }
public static int licenseNameFor(String license) { public static int licenseNameFor(String license) {
@ -236,7 +236,7 @@ public class Utils {
} else if (license.equals(Prefs.Licenses.CC_BY_SA)) { // for backward compatibility to v2.1 } else if (license.equals(Prefs.Licenses.CC_BY_SA)) { // for backward compatibility to v2.1
return R.string.license_name_cc_by_sa_3_0; return R.string.license_name_cc_by_sa_3_0;
} }
throw new RuntimeException("Unrecognized license value"); throw new RuntimeException("Unrecognized license value: " + license);
} }
public static String licenseUrlFor(String license) { public static String licenseUrlFor(String license) {
@ -251,7 +251,7 @@ public class Utils {
} else if (license.equals(Prefs.Licenses.CC0)) { } else if (license.equals(Prefs.Licenses.CC0)) {
return "https://creativecommons.org/publicdomain/zero/1.0/"; return "https://creativecommons.org/publicdomain/zero/1.0/";
} }
throw new RuntimeException("Unrecognized license value"); throw new RuntimeException("Unrecognized license value: " + license);
} }
public static Uri uriForWikiPage(String name) { public static Uri uriForWikiPage(String name) {