| 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} (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 } |
| OLD | NEW |