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

Side by Side 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: Rewrite for design changes as discussed Created 4 years, 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package org.chromium.net;
6
7 /**
8 * Subclass of {@link UrlRequestException} (through {@link CronetException}) whi ch contains a
9 * detailed QUIC error code from
10 * <a href=https://chromium.googlesource.com/chromium/src/+/master/net/quic/quic _protocol.h#503>
11 * this file</a>.
12 * An instance of QuicException is passed to
13 * {@link UrlRequest.Callback#onFailed UrlRequest.Callback.onFailed()} when the net error code is
14 * {@link UrlRequestException#QUIC_PROTOCOL_ERROR UrlRequestException.QUIC_PROTO COL_ERROR}.
15 */
16 public class QuicException extends CronetException {
17 // QUIC detailed error code
18 private final int mQuicDetailedErrorCode;
19
20 /**
21 * Constructs an exception with a specific error.
22 *
23 * @param message explanation of failure.
24 * @param quicDetailedErrorCode Detailed QUIC error code from
25 * <a href=https://chromium.googlesource.com/chromium/src/+/master/net/quic/ quic_protocol.h#503>
26 * this file</a>.
27 */
28 public QuicException(String message, int quicDetailedErrorCode) {
29 super(message, ERROR_OTHER, QUIC_PROTOCOL_ERROR);
30 mQuicDetailedErrorCode = quicDetailedErrorCode;
31 }
32
33 /**
34 * Returns the QUIC error code, which is a value from
35 * <a href=https://chromium.googlesource.com/chromium/src/+/master/net/quic/ quic_protocol.h>
36 * QuicErrorCode</a>.
37 */
38 public int getQuicDetailedErrorCode() {
39 return mQuicDetailedErrorCode;
40 }
41 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698