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

Unified Diff: components/cronet/android/api/src/org/chromium/net/UrlRequestException.java

Issue 2506653003: Instrument CronetUrlRequestTest#testThrowOrCancelInOnCanceled flaky test (Closed)
Patch Set: Created 4 years, 1 month 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
Index: components/cronet/android/api/src/org/chromium/net/UrlRequestException.java
diff --git a/components/cronet/android/api/src/org/chromium/net/UrlRequestException.java b/components/cronet/android/api/src/org/chromium/net/UrlRequestException.java
index 8cbeafbc098441dbee4b469573a96e8d8c91f924..10bb7216c3982080c31bd61f7b6d3fb2391dd9d4 100644
--- a/components/cronet/android/api/src/org/chromium/net/UrlRequestException.java
+++ b/components/cronet/android/api/src/org/chromium/net/UrlRequestException.java
@@ -161,4 +161,19 @@ public class UrlRequestException extends IOException {
return true;
}
}
+
+ @Override
+ public String toString() {
Charles 2016/11/15 19:08:16 Usually the preferred way to do this would be to a
kapishnikov 2016/11/15 21:17:01 I cannot pass the augmented message to the superty
Charles 2016/11/15 21:38:22 Why can't you pass it to the supertype constructor
+ StringBuilder b = new StringBuilder();
+ b.append(super.toString());
+ b.append(", ErrorCode=").append(mErrorCode);
+ if (mCronetInternalErrorCode != 0) {
+ b.append(", InternalErrorCode=").append(mCronetInternalErrorCode);
+ }
+ b.append(", Retriable=").append(immediatelyRetryable());
+ if (getCause() != null) {
+ b.append(", Cause=").append(getCause().toString());
+ }
+ return b.toString();
+ }
}

Powered by Google App Engine
This is Rietveld 408576698