| OLD | NEW |
| (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} which contains a detailed |
| 9 * <a href="https://www.chromium.org/quic">QUIC</a> error code from <a |
| 10 * 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> |
| 11 * QuicErrorCode</a>. An instance of {@code QuicException} is passed to {@code o
nFailed} callbacks |
| 12 * when the error code is {@link UrlRequestException#ERROR_QUIC_PROTOCOL_FAILED |
| 13 * UrlRequestException.ERROR_QUIC_PROTOCOL_FAILED}. |
| 14 */ |
| 15 public class QuicException extends CronetException { |
| 16 private final int mQuicDetailedErrorCode; |
| 17 |
| 18 /** |
| 19 * Constructs an exception with a specific error. |
| 20 * |
| 21 * @param message explanation of failure. |
| 22 * @param netErrorCode Error code from |
| 23 * <a href=https://chromium.googlesource.com/chromium/src/+/master/net/base/
net_error_list.h> |
| 24 * this list</a>. |
| 25 * @param quicDetailedErrorCode Detailed <a href="https://www.chromium.org/q
uic">QUIC</a> error |
| 26 * code from <a |
| 27 * href=https://cs.chromium.org/chromium/src/net/quic/quic_protocol.h?type=c
s&q=%22enum+QuicErrorCode+%7B%22+file:src/net/quic/quic_protocol.h> |
| 28 * QuicErrorCode</a>. |
| 29 */ |
| 30 public QuicException(String message, int netErrorCode, int quicDetailedError
Code) { |
| 31 super(message, ERROR_QUIC_PROTOCOL_FAILED, netErrorCode); |
| 32 mQuicDetailedErrorCode = quicDetailedErrorCode; |
| 33 } |
| 34 |
| 35 /** |
| 36 * Returns the <a href="https://www.chromium.org/quic">QUIC</a> error code,
which is a value |
| 37 * from <a |
| 38 * href=https://cs.chromium.org/chromium/src/net/quic/quic_protocol.h?type=c
s&q=%22enum+QuicErrorCode+%7B%22+file:src/net/quic/quic_protocol.h> |
| 39 * QuicErrorCode</a>. |
| 40 */ |
| 41 public int getQuicDetailedErrorCode() { |
| 42 return mQuicDetailedErrorCode; |
| 43 } |
| 44 } |
| OLD | NEW |