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

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

Issue 2069303002: Add new Cronet exception class for QUIC errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Switch to using NetError 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/QuicException.java
diff --git a/components/cronet/android/api/src/org/chromium/net/QuicException.java b/components/cronet/android/api/src/org/chromium/net/QuicException.java
new file mode 100644
index 0000000000000000000000000000000000000000..9e2ebdb21499b6738f161d69d7efdeb0e31bba28
--- /dev/null
+++ b/components/cronet/android/api/src/org/chromium/net/QuicException.java
@@ -0,0 +1,44 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.net;
+
+/**
+ * Subclass of {@link UrlRequestException} (through {@link CronetException}) which contains a
+ * detailed QUIC error code from
pauljensen 2016/06/30 17:35:12 I'd recommend linkifying QUIC here and on line 37
mgersh 2016/06/30 22:55:52 Done.
+ * <a href=https://chromium.googlesource.com/chromium/src/+/master/net/quic/quic_protocol.h#503>
+ * this file</a>.
+ * An instance of QuicException is passed to
+ * {@link UrlRequest.Callback#onFailed UrlRequest.Callback.onFailed()} when the net error code is
+ * QUIC_PROTOCOL_ERROR.
+ */
+public class QuicException extends CronetException {
+ // QUIC detailed error code
+ private final int mQuicDetailedErrorCode;
+
+ /**
+ * Constructs an exception with a specific error.
+ *
+ * @param message explanation of failure.
+ * @param netErrorCode Error code from
+ * <a href=https://chromium.googlesource.com/chromium/src/+/master/net/base/net_error_list.h>
+ * this list</a>.
+ * @param quicDetailedErrorCode Detailed QUIC error code from
+ * <a href=https://chromium.googlesource.com/chromium/src/+/master/net/quic/quic_protocol.h#503>
+ * this file</a>.
+ */
+ public QuicException(String message, int netErrorCode, int quicDetailedErrorCode) {
+ super(message, ERROR_OTHER, netErrorCode);
+ mQuicDetailedErrorCode = quicDetailedErrorCode;
+ }
+
+ /**
+ * Returns the QUIC error code, which is a value from
+ * <a href=https://chromium.googlesource.com/chromium/src/+/master/net/quic/quic_protocol.h>
+ * QuicErrorCode</a>.
+ */
+ public int getQuicDetailedErrorCode() {
+ return mQuicDetailedErrorCode;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698