Stay organized with collections
Save and categorize content based on your preferences.
GoogleMobileAds.Api.AdError
Error information about why an ad operation failed.
Summary
Inheritance
Direct Known Subclasses:
GoogleMobileAds.Api.AdInspectorError,
GoogleMobileAds.Api.LoadAdError
Constructors and Destructors
|
AdError(IAdErrorClient client)
|
Public functions
|
GetCause()
|
|
GetCode()
|
int
Returns the error code.
|
GetDomain()
|
string
Return "MobileAds" for Google Mobile Ads SDK errors, or a domain defined by mediation networks for mediation errors.
|
GetMessage()
|
string
Returns the error message.
|
ToString()
|
override string
Returns a log friendly string version of this object.
|
Public functions
AdError
AdError(
IAdErrorClient client
)
Creates a AdError.
Details |
Parameters |
client
|
A platform level IAdErrorClient implementation.
|
|
GetCode
int GetCode()
Returns the error code.
Details |
Returns
|
The error code.
|
GetDomain
string GetDomain()
Return "MobileAds" for Google Mobile Ads SDK errors, or a domain defined by mediation networks for mediation errors.
Details |
Returns
|
The error domain.
|
GetMessage
string GetMessage()
Returns the error message.
for explanations of common errors.
summary> Returns the cause of this error or null
if the cause is nonexistent or unknown.
Details |
Returns
|
Ad Error Message.
|
Details |
Returns
|
Returns the cause of this error.
|
ToString
override string ToString()
Returns a log friendly string version of this object.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-20 UTC.
[null,null,["Last updated 2025-08-20 UTC."],[[["\u003cp\u003e\u003ccode\u003eGoogleMobileAds.Api.AdError\u003c/code\u003e provides detailed information about why an ad operation failed within the Google Mobile Ads SDK.\u003c/p\u003e\n"],["\u003cp\u003eIt includes an error code, domain, and message to help developers diagnose and resolve issues.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can access the error details using functions like \u003ccode\u003eGetCode()\u003c/code\u003e, \u003ccode\u003eGetDomain()\u003c/code\u003e, and \u003ccode\u003eGetMessage()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eAdError\u003c/code\u003e also provides a \u003ccode\u003eGetCause()\u003c/code\u003e function to identify the underlying reason for the error.\u003c/p\u003e\n"]]],["`AdError` provides information about failed ad operations. Key actions include creating an `AdError` instance with an `IAdErrorClient`, and retrieving error details using functions like `GetCode()` to get the error code, `GetDomain()` to identify the error source (e.g., \"MobileAds\"), `GetMessage()` to read the error message, and `GetCause()` to get the error's cause. `ToString()` returns a user-friendly string. Subclasses include `AdInspectorError` and `LoadAdError`.\n"],null,["# GoogleMobileAds.Api.AdError Class Reference\n\nGoogleMobileAds.Api.AdError\n===========================\n\nError information about why an ad operation failed.\n\nSummary\n-------\n\n### Inheritance\n\nDirect Known Subclasses:[GoogleMobileAds.Api.AdInspectorError](/ad-manager/mobile-ads-sdk/unity/reference/class/google-mobile-ads/api/ad-inspector-error), [GoogleMobileAds.Api.LoadAdError](/ad-manager/mobile-ads-sdk/unity/reference/class/google-mobile-ads/api/load-ad-error)\n\n| ### Constructors and Destructors ||\n|---|---|\n| [AdError](#class_google_mobile_ads_1_1_api_1_1_ad_error_1a6d8161bf26eb2e55ea0b1d6b1f849c6a)`(IAdErrorClient client)` Creates a [AdError](/ad-manager/mobile-ads-sdk/unity/reference/class/google-mobile-ads/api/ad-error#class_google_mobile_ads_1_1_api_1_1_ad_error). ||\n\n| ### Public functions ||\n|----------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------|\n| [GetCause](#class_google_mobile_ads_1_1_api_1_1_ad_error_1a772714bb55cf597ccb366ef4ecc40565)`()` | [AdError](/ad-manager/mobile-ads-sdk/unity/reference/class/google-mobile-ads/api/ad-error#class_google_mobile_ads_1_1_api_1_1_ad_error) |\n| [GetCode](#class_google_mobile_ads_1_1_api_1_1_ad_error_1ac39ffb441248bd614be31cbc4c978ac9)`()` | `int` Returns the error code. |\n| [GetDomain](#class_google_mobile_ads_1_1_api_1_1_ad_error_1ac5c3976cc9174eba7537910db8a637dc)`()` | `string` Return \"MobileAds\" for Google Mobile Ads SDK errors, or a domain defined by mediation networks for mediation errors. |\n| [GetMessage](#class_google_mobile_ads_1_1_api_1_1_ad_error_1a6c11b50c5d0b67cb6688bf7953ac3047)`()` | `string` Returns the error message. |\n| [ToString](#class_google_mobile_ads_1_1_api_1_1_ad_error_1a240806b07b263aa04c2d2147d9a0646d)`()` | `override string` Returns a log friendly string version of this object. |\n\nPublic functions\n----------------\n\n### AdError\n\n```c#\n AdError(\n IAdErrorClient client\n)\n``` \nCreates a [AdError](/ad-manager/mobile-ads-sdk/unity/reference/class/google-mobile-ads/api/ad-error#class_google_mobile_ads_1_1_api_1_1_ad_error).\n\n\u003cbr /\u003e\n\n| Details ||\n|------------|-------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |----------|-------------------------------------------------| | `client` | A platform level IAdErrorClient implementation. | |\n\n### GetCause\n\n```c#\nAdError GetCause()\n``` \n\n### GetCode\n\n```c#\nint GetCode()\n``` \nReturns the error code.\n\n\u003cbr /\u003e\n\n| Details ||\n|-------------|-----------------|\n| **Returns** | The error code. |\n\n### GetDomain\n\n```c#\nstring GetDomain()\n``` \nReturn \"MobileAds\" for Google Mobile Ads SDK errors, or a domain defined by mediation networks for mediation errors.\n\n\u003cbr /\u003e\n\n| Details ||\n|-------------|-------------------|\n| **Returns** | The error domain. |\n\n### GetMessage\n\n```c#\nstring GetMessage()\n``` \nReturns the error message.\n\nfor explanations of common errors.\n\n\nsummary\\\u003e Returns the cause of this error or `null` if the cause is nonexistent or unknown.\n\n| Details ||\n|-------------|-------------------|\n| **Returns** | Ad Error Message. |\n\n\u003cbr /\u003e\n\n| Details ||\n|-------------|----------------------------------|\n| **Returns** | Returns the cause of this error. |\n\n### ToString\n\n```c#\noverride string ToString()\n``` \nReturns a log friendly string version of this object."]]