1 // Copyright 2016 The Chromium Authors 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 android.net.http; 6 7 import androidx.annotation.Nullable; 8 9 /** 10 * Exception passed to {@link UrlRequest.Callback#onFailed UrlRequest.Callback.onFailed()} when 11 * {@link UrlRequest.Callback} or {@link UploadDataProvider} method throws an exception. In this 12 * case {@link java.io.IOException#getCause getCause()} can be used to find the thrown exception. 13 */ 14 public abstract class CallbackException extends HttpException { 15 /** 16 * Constructs an exception that wraps {@code cause} thrown by a {@link UrlRequest.Callback}. 17 * 18 * @param message explanation of failure. 19 * @param cause exception thrown by {@link UrlRequest.Callback} that's being wrapped. It is 20 * saved 21 * for later retrieval by the {@link java.io.IOException#getCause getCause()}. 22 */ CallbackException(@ullable String message, @Nullable Throwable cause)23 protected CallbackException(@Nullable String message, @Nullable Throwable cause) { 24 super(message, cause); 25 } 26 } 27