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

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: header 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..54f362653f1027a8ab4f77dfa5e8a90d42cb7b52
--- /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} which contains a detailed
+ * <a href="https://www.chromium.org/quic">QUIC</a> error code from <a
+ * href=https://cs.chromium.org/chromium/src/net/quic/quic_protocol.h?type=cs&q=%22enum+QuicErrorCode+%7B%22+file:src/net/quic/quic_protocol.h>
+ * QuicErrorCode</a>. An instance of {@code QuicException} is passed to {@code onFailed} callbacks
+ * when the error code is {@link UrlRequestException#ERROR_QUIC_PROTOCOL_FAILED
+ * UrlRequestException.ERROR_QUIC_PROTOCOL_FAILED}.
+ */
+public class QuicException extends CronetException {
+ 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 <a href="https://www.chromium.org/quic">QUIC</a> error
+ * code from <a
+ * href=https://cs.chromium.org/chromium/src/net/quic/quic_protocol.h?type=cs&q=%22enum+QuicErrorCode+%7B%22+file:src/net/quic/quic_protocol.h>
+ * QuicErrorCode</a>.
+ */
+ public QuicException(String message, int netErrorCode, int quicDetailedErrorCode) {
+ super(message, ERROR_QUIC_PROTOCOL_FAILED, netErrorCode);
+ mQuicDetailedErrorCode = quicDetailedErrorCode;
+ }
+
+ /**
+ * Returns the <a href="https://www.chromium.org/quic">QUIC</a> error code, which is a value
+ * from <a
+ * href=https://cs.chromium.org/chromium/src/net/quic/quic_protocol.h?type=cs&q=%22enum+QuicErrorCode+%7B%22+file:src/net/quic/quic_protocol.h>
+ * QuicErrorCode</a>.
+ */
+ public int getQuicDetailedErrorCode() {
+ return mQuicDetailedErrorCode;
+ }
+}
« no previous file with comments | « components/cronet/android/BUILD.gn ('k') | components/cronet/android/api/src/org/chromium/net/UrlRequestException.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698