# AdServicesException

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[Ad Services Extensions 4](https://developer.android.com/sdkExtensions)

# AdServicesException

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/adservices/exceptions/AdServicesException "View this page in Java")  

```
open class AdServicesException : Exception
```

|---|---|---|--------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                               ||||
| ↳ | [kotlin.Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)                                                                |||
|   | ↳ | [java.lang.Exception](https://developer.android.com/reference/kotlin/java/lang/Exception.html#)                                                           ||
|   |   | ↳ | [android.adservices.exceptions.AdServicesException](https://developer.android.com/reference/kotlin/android/adservices/exceptions/AdServicesException#) |

Exception thrown by AdServices.

## Summary

|                                                                                                                                                                                    Public constructors                                                                                                                                                                                     ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [AdServicesException](https://developer.android.com/reference/kotlin/android/adservices/exceptions/AdServicesException#AdServicesException(kotlin.String))`(`message:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?`)` <br />                                                                                                                     |
| [AdServicesException](https://developer.android.com/reference/kotlin/android/adservices/exceptions/AdServicesException#AdServicesException(kotlin.String,%20kotlin.Throwable))`(`message:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?`, `e:` `[Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)?`)` <br /> |

## Public constructors

### AdServicesException

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[Ad Services Extensions 4](https://developer.android.com/sdkExtensions)  

```
AdServicesException(message: String?)
```

|                                                      Parameters                                                       ||
|-----------|------------------------------------------------------------------------------------------------------------|
| `message` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?:This value may be`null`. |

### AdServicesException

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Also in[Ad Services Extensions 4](https://developer.android.com/sdkExtensions)  

```
AdServicesException(
    message: String?, 
    e: Throwable?)
```

|                                                         Parameters                                                          ||
|-----------|------------------------------------------------------------------------------------------------------------------|
| `message` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?:This value may be`null`.       |
| `e`       | [Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)?:This value may be`null`. |