| 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..5db3843e148114af3d0db046006598f9a51cd171
|
| --- /dev/null
|
| +++ b/components/cronet/android/api/src/org/chromium/net/QuicException.java
|
| @@ -0,0 +1,41 @@
|
| +// 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
|
| + * detailed QUIC error code from
|
| + * <a href=https://chromium.googlesource.com/chromium/src/+/master/net/quic/quic_protocol.h#503>
|
| + * this file</a>.
|
| + * An instance of QuicException is passed to
|
| + * {@link UrlRequest.Callback#onFailed UrlRequest.Callback.onFailed()} when the net error code is
|
| + * {@link UrlRequestException#QUIC_PROTOCOL_ERROR UrlRequestException.QUIC_PROTOCOL_ERROR}.
|
| + */
|
| +public class QuicException extends CronetException {
|
| + // QUIC detailed error code
|
| + private final int mQuicDetailedErrorCode;
|
| +
|
| + /**
|
| + * Constructs an exception with a specific error.
|
| + *
|
| + * @param message explanation of failure.
|
| + * @param quicDetailedErrorCode Detailed QUIC error code from
|
| + * <a href=https://chromium.googlesource.com/chromium/src/+/master/net/quic/quic_protocol.h#503>
|
| + * this file</a>.
|
| + */
|
| + public QuicException(String message, int quicDetailedErrorCode) {
|
| + super(message, ERROR_OTHER, QUIC_PROTOCOL_ERROR);
|
| + mQuicDetailedErrorCode = quicDetailedErrorCode;
|
| + }
|
| +
|
| + /**
|
| + * Returns the QUIC error code, which is a value from
|
| + * <a href=https://chromium.googlesource.com/chromium/src/+/master/net/quic/quic_protocol.h>
|
| + * QuicErrorCode</a>.
|
| + */
|
| + public int getQuicDetailedErrorCode() {
|
| + return mQuicDetailedErrorCode;
|
| + }
|
| +}
|
|
|