Stay organized with collections
Save and categorize content based on your preferences.
IsolatedServiceException
class IsolatedServiceException : Exception
A class that an IsolatedService
can use to signal a failure in handling a request and return an error to be logged and aggregated. The error is not reported to the app that invoked the IsolatedService
in order to prevent data leakage from the IsolatedService
to an app. The platform does not interpret the error code, it only logs and aggregates it.
Summary
Public methods |
Int |
Returns the error code for this exception.
|
Public constructors
IsolatedServiceException
IsolatedServiceException(errorCode: Int)
Creates an IsolatedServiceException
with an error code to be logged. The meaning of the error code is defined by the IsolatedService
. The platform does not interpret the error code.
IsolatedServiceException
IsolatedServiceException(
errorCode: Int,
message: String?,
cause: Throwable?)
Creates an IsolatedServiceException
with an error code to be logged. The meaning of the error code is defined by the IsolatedService
. The platform does not interpret the error code.
Parameters |
errorCode |
Int: An error code defined by the IsolatedService . |
message |
String?: the exception message. This value may be null . |
cause |
Throwable?: the cause of this exception. This value may be null . |
IsolatedServiceException
IsolatedServiceException(
errorCode: Int,
cause: Throwable?)
Creates an IsolatedServiceException
with an error code to be logged. The meaning of the error code is defined by the IsolatedService
. The platform does not interpret the error code.
Parameters |
errorCode |
Int: An error code defined by the IsolatedService . |
cause |
Throwable?: the cause of this exception. This value may be null . |
Public methods
getErrorCode
fun getErrorCode(): Int
Returns the error code for this exception.
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-03-13 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-03-13 UTC."],[],[],null,["# IsolatedServiceException\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nIsolatedServiceException\n========================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/adservices/ondevicepersonalization/IsolatedServiceException \"View this page in Java\") \n\n```\nclass IsolatedServiceException : Exception\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| | | ↳ | [android.adservices.ondevicepersonalization.IsolatedServiceException](#) |\n\nA class that an [IsolatedService](/reference/kotlin/android/adservices/ondevicepersonalization/IsolatedService) can use to signal a failure in handling a request and return an error to be logged and aggregated. The error is not reported to the app that invoked the [IsolatedService](/reference/kotlin/android/adservices/ondevicepersonalization/IsolatedService) in order to prevent data leakage from the [IsolatedService](/reference/kotlin/android/adservices/ondevicepersonalization/IsolatedService) to an app. The platform does not interpret the error code, it only logs and aggregates it.\n\nSummary\n-------\n\n| Public constructors ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [IsolatedServiceException](#IsolatedServiceException(kotlin.Int))`(`errorCode:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Creates an [IsolatedServiceException](#) with an error code to be logged. |\n| [IsolatedServiceException](#IsolatedServiceException(kotlin.Int,%20kotlin.String,%20kotlin.Throwable))`(`errorCode:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `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)?`)` Creates an [IsolatedServiceException](#) with an error code to be logged. |\n| [IsolatedServiceException](#IsolatedServiceException(kotlin.Int,%20kotlin.Throwable))`(`errorCode:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `cause:` `[Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)?`)` Creates an [IsolatedServiceException](#) with an error code to be logged. |\n\n| Public methods ||\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getErrorCode](#getErrorCode())`()` Returns the error code for this exception. |\n\nPublic constructors\n-------------------\n\n### IsolatedServiceException\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nIsolatedServiceException(errorCode: Int)\n```\n\nCreates an [IsolatedServiceException](#) with an error code to be logged. The meaning of the error code is defined by the [IsolatedService](/reference/kotlin/android/adservices/ondevicepersonalization/IsolatedService). The platform does not interpret the error code.\n\n| Parameters ||\n|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `errorCode` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): An error code defined by the [IsolatedService](/reference/kotlin/android/adservices/ondevicepersonalization/IsolatedService). |\n\n### IsolatedServiceException\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nIsolatedServiceException(\n errorCode: Int, \n message: String?, \n cause: Throwable?)\n```\n\nCreates an [IsolatedServiceException](#) with an error code to be logged. The meaning of the error code is defined by the [IsolatedService](/reference/kotlin/android/adservices/ondevicepersonalization/IsolatedService). The platform does not interpret the error code.\n\n| Parameters ||\n|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `errorCode` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): An error code defined by the [IsolatedService](/reference/kotlin/android/adservices/ondevicepersonalization/IsolatedService). |\n| `message` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?: the exception message. This value may be `null`. |\n| `cause` | [Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)?: the cause of this exception. This value may be `null`. |\n\n### IsolatedServiceException\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nIsolatedServiceException(\n errorCode: Int, \n cause: Throwable?)\n```\n\nCreates an [IsolatedServiceException](#) with an error code to be logged. The meaning of the error code is defined by the [IsolatedService](/reference/kotlin/android/adservices/ondevicepersonalization/IsolatedService). The platform does not interpret the error code.\n\n| Parameters ||\n|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `errorCode` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): An error code defined by the [IsolatedService](/reference/kotlin/android/adservices/ondevicepersonalization/IsolatedService). |\n| `cause` | [Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)?: the cause of this exception. This value may be `null`. |\n\nPublic methods\n--------------\n\n### getErrorCode\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getErrorCode(): Int\n```\n\nReturns the error code for this exception."]]