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
int
Returns the error code.
string
Return "MobileAds" for Google Mobile Ads SDK errors, or a domain defined by mediation networks for mediation errors.
string
Returns the error message.
override string
Returns a log friendly string version of this object.
Public functions
AdError
AdError
(
IAdErrorClient
client
)
Creates a AdError
.
Parameters
client
A platform level IAdErrorClient implementation.
GetCause
AdError
GetCause
()
GetDomain
string
GetDomain
()
Return "MobileAds" for Google Mobile Ads SDK errors, or a domain defined by mediation networks for mediation errors.
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.
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.
[[["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-08-20 UTC."],[[["\u003cp\u003e\u003ccode\u003eGoogleMobileAds.Api.AdError\u003c/code\u003e provides detailed information about why an ad operation failed.\u003c/p\u003e\n"],["\u003cp\u003eIt includes an error code, domain, and message to help diagnose the issue.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use the \u003ccode\u003eGetCause\u003c/code\u003e, \u003ccode\u003eGetCode\u003c/code\u003e, \u003ccode\u003eGetDomain\u003c/code\u003e, and \u003ccode\u003eGetMessage\u003c/code\u003e functions to access error details.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eToString\u003c/code\u003e function provides a log-friendly representation of the error object.\u003c/p\u003e\n"],["\u003cp\u003eIt is inherited by classes like \u003ccode\u003eAdInspectorError\u003c/code\u003e and \u003ccode\u003eLoadAdError\u003c/code\u003e to provide specific error information.\u003c/p\u003e\n"]]],["`AdError` provides details on ad operation failures. It has subclasses like `AdInspectorError` and `LoadAdError`. Key actions include: creating an `AdError` with an `IAdErrorClient`, retrieving error details like the code (`GetCode`), domain (`GetDomain`), message (`GetMessage`), and cause (`GetCause`), also can return a log-friendly string version of this object using (`ToString`). The domain indicates if the error is from Google Mobile Ads or a mediation network.\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](/admob/unity/reference/class/google-mobile-ads/api/ad-inspector-error), [GoogleMobileAds.Api.LoadAdError](/admob/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](/admob/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](/admob/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](/admob/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."]]