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

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

Issue 2069303002: Add new Cronet exception class for QUIC errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
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 92201aa32471128ce721a81cab80fbf8b061f73b..10d8a9ca574842f8cb4323a91e72d376e8115ca0 100644
--- a/components/cronet/android/api/src/org/chromium/net/UrlRequestException.java
+++ b/components/cronet/android/api/src/org/chromium/net/UrlRequestException.java
@@ -73,6 +73,8 @@ public class UrlRequestException extends IOException {
private final int mErrorCode;
// Cronet internal error code.
private final int mCronetInternalErrorCode;
+ // Cronet internal error details.
+ private final int mCronetInternalErrorDetails;
/**
* Constructs an exception with a specific error.
@@ -82,11 +84,17 @@ public class UrlRequestException extends IOException {
* @param cronetInternalErrorCode Cronet internal error code, one of
* <a href=https://chromium.googlesource.com/chromium/src/+/master/net/base/net_error_list.h>
* these</a>.
+ * @param cronetInternalErrorDetails Cronet internal error code details when the error code
+ * is QUIC_PROTOCOL_ERROR, from
+ * <a href=https://chromium.googlesource.com/chromium/src/+/master/net/quic/quic_protocol.h#503>
+ * this file</a>.
*/
- public UrlRequestException(String message, int errorCode, int cronetInternalErrorCode) {
+ public UrlRequestException(String message, int errorCode, int cronetInternalErrorCode,
+ int cronetInternalErrorDetails) {
super(message, null);
mErrorCode = errorCode;
mCronetInternalErrorCode = cronetInternalErrorCode;
+ mCronetInternalErrorDetails = cronetInternalErrorDetails;
}
/**
@@ -99,6 +107,7 @@ public class UrlRequestException extends IOException {
super(message, cause);
mErrorCode = ERROR_LISTENER_EXCEPTION_THROWN;
mCronetInternalErrorCode = 0;
+ mCronetInternalErrorDetails = 0;
}
/**
@@ -124,6 +133,17 @@ public class UrlRequestException extends IOException {
}
/**
+ * Returns detailed information related to the Cronet internal error code. Currently this is a
+ * code from
+ * <a href=https://chromium.googlesource.com/chromium/src/+/master/net/quic/quic_protocol.h>
+ * QuicErrorCode</a> and is only meaningful if the Cronet internal error code is
+ * QUIC_PROTOCOL_ERROR.
+ */
+ public int getCronetInternalErrorDetails() {
+ return mCronetInternalErrorDetails;
+ }
+
+ /**
* Returns {@code true} if retrying this request right away might succeed, {@code false}
* otherwise. For example returns {@code true} when {@link #getErrorCode} returns
* {@link #ERROR_NETWORK_CHANGED} because trying the request might succeed using the new

Powered by Google App Engine
This is Rietveld 408576698