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

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: Add UrlRequestException top-level error for QUIC, and other comments 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..e355c26b845d0e1779a52f752fee9be1464cdb9d
--- /dev/null
+++ b/components/cronet/android/api/src/org/chromium/net/QuicException.java
@@ -0,0 +1,47 @@
+// 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
pauljensen 2016/07/01 12:22:02 I don't think we need to mention CronetException..
mgersh 2016/07/01 15:21:15 Done.
+ * detailed <a href="https://www.chromium.org/quic">QUIC</a> error code from
+ * <a href=https://chromium.googlesource.com/chromium/src/+/master/net/quic/quic_protocol.h#503>
pauljensen 2016/07/01 12:22:02 Line 503 is already incorrect. I was going to sugg
mgersh 2016/07/01 15:21:15 Huh, cool. Done.
+ * this file</a>.
+ * An instance of QuicException is passed to
pauljensen 2016/07/01 12:22:02 can this go on prior line?
pauljensen 2016/07/01 12:22:02 QuicException->{@code QuicException}
mgersh 2016/07/01 15:21:15 You mean I can't just solve all my formatting prob
mgersh 2016/07/01 15:21:15 Done.
+ * {@link UrlRequest.Callback#onFailed UrlRequest.Callback.onFailed()} when the error code is
pauljensen 2016/07/01 12:22:02 I'm not sure we should mention UrlRequest here as
mgersh 2016/07/01 15:21:15 Done.
+ * {@link UrlRequestException#ERROR_QUIC_PROTOCOL_FAILED
+ * UrlRequestException.ERROR_QUIC_PROTOCOL_FAILED}.
+ */
+public class QuicException extends CronetException {
+ // QUIC detailed error code
pauljensen 2016/07/01 12:22:02 Remove this comment as it is redundant with the ni
mgersh 2016/07/01 15:21:15 Done. I agree with you that it's weird, I just did
+ 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://chromium.googlesource.com/chromium/src/+/master/net/quic/quic_protocol.h#503>
pauljensen 2016/07/01 12:22:02 Update URL as per line 10 comment
mgersh 2016/07/01 15:21:15 Done.
+ * this file</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://chromium.googlesource.com/chromium/src/+/master/net/quic/quic_protocol.h>
pauljensen 2016/07/01 12:22:02 update URL as per line 10 comment
mgersh 2016/07/01 15:21:15 Done.
+ * QuicErrorCode</a>.
pauljensen 2016/07/01 12:22:02 please make this consistent with the other two ref
mgersh 2016/07/01 15:21:15 Done.
+ */
+ public int getQuicDetailedErrorCode() {
+ return mQuicDetailedErrorCode;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698