Stay organized with collections
Save and categorize content based on your preferences.
HttpException
open class HttpException : IOException
Known Indirect Subclasses
|
Base exception passed to UrlRequest.Callback.onFailed()
.
Summary
Public constructors |
Constructs an exception that is caused by cause .
|
Public constructors
HttpException
HttpException(
message: String?,
cause: Throwable?)
Constructs an exception that is caused by cause
.
Parameters |
message |
String?: explanation of failure. This value may be null . |
cause |
Throwable?: the cause (which is saved for later retrieval by the getCause() method). A null value is permitted, and indicates that the cause is nonexistent or unknown. |
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# HttpException\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\nHttpException\n=============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/net/http/HttpException \"View this page in Java\") \n\n```\nopen class HttpException : IOException\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](#) |\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [CallbackException](/reference/kotlin/android/net/http/CallbackException), [NetworkException](/reference/kotlin/android/net/http/NetworkException) |---------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [CallbackException](/reference/kotlin/android/net/http/CallbackException) | Exception 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. | | [NetworkException](/reference/kotlin/android/net/http/NetworkException) | Exception 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 the HTTP stack fails to process a network request. | |\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Indirect Subclasses [QuicException](/reference/kotlin/android/net/http/QuicException) |-------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [QuicException](/reference/kotlin/android/net/http/QuicException) | Subclass of [NetworkException](/reference/kotlin/android/net/http/NetworkException) which contains a detailed [QUIC](https://www.chromium.org/quic) error code from [QuicErrorCode](https://cs.chromium.org/search/?q=symbol:%5CbQuicErrorCode%5Cb). | |\n\nBase exception 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)).\n\nSummary\n-------\n\n| Public constructors ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [HttpException](#HttpException(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 is caused by `cause`. |\n\nPublic constructors\n-------------------\n\n### HttpException\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```\nHttpException(\n message: String?, \n cause: Throwable?)\n```\n\nConstructs an exception that is caused by `cause`.\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)?: the cause (which is saved for later retrieval by the [getCause()](../../../java/lang/Throwable.html#getCause()) method). A null value is permitted, and indicates that the cause is nonexistent or unknown. |"]]