Chromium Code Reviews| 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..9e2ebdb21499b6738f161d69d7efdeb0e31bba28 |
| --- /dev/null |
| +++ b/components/cronet/android/api/src/org/chromium/net/QuicException.java |
| @@ -0,0 +1,44 @@ |
| +// 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 |
|
pauljensen
2016/06/30 17:35:12
I'd recommend linkifying QUIC here and on line 37
mgersh
2016/06/30 22:55:52
Done.
|
| + * <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 |
| + * 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 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 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 netErrorCode, int quicDetailedErrorCode) { |
| + super(message, ERROR_OTHER, netErrorCode); |
| + 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; |
| + } |
| +} |