Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4030)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/util/IntentUtils.java

Issue 2405983002: Catch TransactionTooLargeException in another case. (Closed)
Patch Set: Address Maria's comment Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/util/IntentUtils.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/util/IntentUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/util/IntentUtils.java
index 033beade4ba8411efb8caa105324db5fbfd56572..3dffaf2bafcda5e7c5ba61545861da6c89435420 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/util/IntentUtils.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/util/IntentUtils.java
@@ -349,4 +349,20 @@ public class IntentUtils {
public static boolean isIntentTooLarge(Intent intent) {
return getParceledIntentSize(intent) > MAX_INTENT_SIZE_THRESHOLD;
}
+
+ /**
+ * Given an exception, check whether it wrapped a {@link TransactionTooLargeException}. If it
+ * does, then log the underlying error. If not, throw the original exception again.
+ *
+ * @param e The caught RuntimeException.
+ * @param intent The intent that triggered the RuntimeException to be thrown.
+ */
+ public static void logTransactionTooLargeOrRethrow(RuntimeException e, Intent intent) {
+ // See http://crbug.com/369574.
+ if (e.getCause() instanceof TransactionTooLargeException) {
+ Log.e(TAG, "Could not resolve Activity for intent " + intent.toString(), e);
+ } else {
+ throw e;
+ }
+ }
}
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698