Stay organized with collections
Save and categorize content based on your preferences.
CallbackException
abstract class CallbackException : HttpException
Exception passed to UrlRequest.Callback.onFailed()
when UrlRequest.Callback
or UploadDataProvider
method throws an exception. In this case getCause()
can be used to find the thrown exception.
Summary
Protected constructors |
Constructs an exception that wraps cause thrown by a UrlRequest.Callback .
|
Protected constructors
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# CallbackException\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [S Extensions 7](https://developer.android.com/sdkExtensions)\n\nCallbackException\n=================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/net/http/CallbackException \"View this page in Java\") \n\n```\nabstract class CallbackException : HttpException\n```\n\n|---|---|---|---|---|-----------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||||||\n| ↳ | [kotlin.Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html) |||||\n| | ↳ | [java.lang.Exception](../../../java/lang/Exception.html#) ||||\n| | | ↳ | [java.io.IOException](../../../java/io/IOException.html#) |||\n| | | | ↳ | [android.net.http.HttpException](/reference/kotlin/android/net/http/HttpException) ||\n| | | | | ↳ | [android.net.http.CallbackException](#) |\n\nException passed to [UrlRequest.Callback.onFailed()](/reference/kotlin/android/net/http/UrlRequest.Callback#onFailed(android.net.http.UrlRequest,%20android.net.http.UrlResponseInfo,%20android.net.http.HttpException)) when [UrlRequest.Callback](/reference/kotlin/android/net/http/UrlRequest.Callback) or [UploadDataProvider](/reference/kotlin/android/net/http/UploadDataProvider) method throws an exception. In this case [getCause()](../../../java/lang/Throwable.html#getCause()) can be used to find the thrown exception.\n\nSummary\n-------\n\n| Protected constructors ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [CallbackException](#CallbackException(kotlin.String,%20kotlin.Throwable))`(`message:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?`, `cause:` `[Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)?`)` Constructs an exception that wraps `cause` thrown by a [UrlRequest.Callback](/reference/kotlin/android/net/http/UrlRequest.Callback). |\n\nProtected constructors\n----------------------\n\n### CallbackException\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [S Extensions 7](https://developer.android.com/sdkExtensions) \n\n```\nprotected CallbackException(\n message: String?, \n cause: Throwable?)\n```\n\nConstructs an exception that wraps `cause` thrown by a [UrlRequest.Callback](/reference/kotlin/android/net/http/UrlRequest.Callback).\n\n| Parameters ||\n|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `message` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?: explanation of failure. This value may be `null`. |\n| `cause` | [Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)?: exception thrown by [UrlRequest.Callback](/reference/kotlin/android/net/http/UrlRequest.Callback) that's being wrapped. It is saved for later retrieval by the [getCause()](../../../java/lang/Throwable.html#getCause()). This value may be `null`. |"]]