Stay organized with collections
Save and categorize content based on your preferences.
firebase::gma::AdError
#include <types.h>
Information about why an ad operation failed.
Summary
Public static attributes
|
kUndefinedDomain
|
const char *const
A domain string which represents an undefined error domain.
|
Public functions
|
GetCause() const
|
Retrieves an AdError which represents the cause of this error.
|
ToString() const
|
virtual const std::string &
Returns a log friendly string version of this object.
|
code() const
|
Gets the error's code.
|
domain() const
|
const std::string &
Gets the domain of the error.
|
message() const
|
const std::string &
Gets the message describing the error.
|
operator=(const AdError & obj)
|
Assignment operator.
|
response_info() const
|
Gets the ResponseInfo if an error occurred during a loadAd operation.
|
Public static attributes
kUndefinedDomain
const char *const kUndefinedDomain
A domain string which represents an undefined error domain.
The GMA SDK returns this domain for domain() method invocations when converting error information from legacy mediation adapter callbacks.
Public functions
AdError
AdError(
const AdError & ad_error
)
GetCause
std::unique_ptr< AdError > GetCause() const
Retrieves an AdError which represents the cause of this error.
Details |
Returns
|
a pointer to an adError which represents the cause of this AdError. If there was no cause then nullptr is returned.
|
ToString
virtual const std::string & ToString() const
Returns a log friendly string version of this object.
domain
const std::string & domain() const
Gets the domain of the error.
message
const std::string & message() const
Gets the message describing the error.
response_info
const ResponseInfo & response_info() const
Gets the ResponseInfo if an error occurred during a loadAd operation.
The ResponseInfo will have empty fields if this AdError does not represent an error stemming from a load ad operation.
~AdError
virtual ~AdError()
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\u003efirebase::gma::AdError\u003c/code\u003e provides information about why an ad operation failed, including an error code, domain, and message.\u003c/p\u003e\n"],["\u003cp\u003eIt offers methods to retrieve the cause of the error and associated response information for loadAd operations.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ekUndefinedDomain\u003c/code\u003e static attribute represents an undefined error domain, often returned when converting information from legacy mediation adapter callbacks.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can utilize the \u003ccode\u003eToString()\u003c/code\u003e method for a log-friendly representation of the error object.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eAdError\u003c/code\u003e includes constructors, destructors, and an assignment operator for object management.\u003c/p\u003e\n"]]],["The `AdError` class provides information about ad operation failures. Key actions include retrieving the error's `code`, `domain`, and `message`, and obtaining the cause of the error via `GetCause`. The `ToString` method returns a string representation of the error. There is also `response_info` to get details if it is related to a loading error. The class includes constructors, a destructor, and an assignment operator for managing `AdError` objects. It has `kUndefinedDomain` for an undefined error domain.\n"],null,["# firebase::gma::AdError Class Reference\n\nfirebase::gma::AdError\n======================\n\n\n`#include \u003ctypes.h\u003e`\n\nInformation about why an ad operation failed.\n\nSummary\n-------\n\n| ### Constructors and Destructors ||\n|---|---|\n| [AdError](#classfirebase_1_1gma_1_1_ad_error_1a1b94324ddc1ab32649bca69ac30eeabb)`()` Default Constructor. ||\n| [AdError](#classfirebase_1_1gma_1_1_ad_error_1a77580c82486072f1df1845d359a13019)`(const `[AdError](/admob/cpp/reference/class/firebase/gma/ad-error#classfirebase_1_1gma_1_1_ad_error)` & ad_error)` Copy Constructor. ||\n| [~AdError](#classfirebase_1_1gma_1_1_ad_error_1a35cd7b4e801b8b6dd066a0276dab9665)`()` Destructor. ||\n\n| ### Public static attributes ||\n|-------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------|\n| [kUndefinedDomain](#classfirebase_1_1gma_1_1_ad_error_1aab24d46d221e40b709989dce691d57e3) | `const char *const` A domain string which represents an undefined error domain. |\n\n| ### Public functions ||\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [GetCause](#classfirebase_1_1gma_1_1_ad_error_1a9bcb2bd806deefc686620cd464b456f9)`() const ` | `std::unique_ptr\u003c `[AdError](/admob/cpp/reference/class/firebase/gma/ad-error#classfirebase_1_1gma_1_1_ad_error)` \u003e` Retrieves an [AdError](/admob/cpp/reference/class/firebase/gma/ad-error#classfirebase_1_1gma_1_1_ad_error) which represents the cause of this error. |\n| [ToString](#classfirebase_1_1gma_1_1_ad_error_1a73725ef1c72109d1999555322064163d)`() const ` | `virtual const std::string &` Returns a log friendly string version of this object. |\n| [code](#classfirebase_1_1gma_1_1_ad_error_1a0a47204c474803b9750526404b92c329)`() const ` | [AdErrorCode](/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14) Gets the error's code. |\n| [domain](#classfirebase_1_1gma_1_1_ad_error_1a74009bc70cd1531c52cf53c3ddbf5669)`() const ` | `const std::string &` Gets the domain of the error. |\n| [message](#classfirebase_1_1gma_1_1_ad_error_1a6cb8f560c3937d1e4b9f7085d261be30)`() const ` | `const std::string &` Gets the message describing the error. |\n| [operator=](#classfirebase_1_1gma_1_1_ad_error_1a585377077c9fb224163e295eb7025780)`(const `[AdError](/admob/cpp/reference/class/firebase/gma/ad-error#classfirebase_1_1gma_1_1_ad_error)` & obj)` | [AdError](/admob/cpp/reference/class/firebase/gma/ad-error#classfirebase_1_1gma_1_1_ad_error)` &` Assignment operator. |\n| [response_info](#classfirebase_1_1gma_1_1_ad_error_1ad31570534f7c9c8098fba6861454fa61)`() const ` | `const `[ResponseInfo](/admob/cpp/reference/class/firebase/gma/response-info#classfirebase_1_1gma_1_1_response_info)` &` Gets the [ResponseInfo](/admob/cpp/reference/class/firebase/gma/response-info#classfirebase_1_1gma_1_1_response_info) if an error occurred during a loadAd operation. |\n\nPublic static attributes\n------------------------\n\n### kUndefinedDomain\n\n```c++\nconst char *const kUndefinedDomain\n``` \nA domain string which represents an undefined error domain.\n\nThe GMA SDK returns this domain for [domain()](/admob/cpp/reference/class/firebase/gma/ad-error#classfirebase_1_1gma_1_1_ad_error_1a74009bc70cd1531c52cf53c3ddbf5669) method invocations when converting error information from legacy mediation adapter callbacks.\n\nPublic functions\n----------------\n\n### AdError\n\n```c++\n AdError()\n``` \nDefault Constructor. \n\n### AdError\n\n```c++\n AdError(\n const AdError & ad_error\n)\n``` \nCopy Constructor. \n\n### GetCause\n\n```c++\nstd::unique_ptr\u003c AdError \u003e GetCause() const \n``` \nRetrieves an [AdError](/admob/cpp/reference/class/firebase/gma/ad-error#classfirebase_1_1gma_1_1_ad_error) which represents the cause of this error.\n\n\u003cbr /\u003e\n\n| Details ||\n|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **Returns** | a pointer to an adError which represents the cause of this [AdError](/admob/cpp/reference/class/firebase/gma/ad-error#classfirebase_1_1gma_1_1_ad_error). If there was no cause then nullptr is returned. |\n\n### ToString\n\n```c++\nvirtual const std::string & ToString() const \n``` \nReturns a log friendly string version of this object. \n\n### code\n\n```c++\nAdErrorCode code() const \n``` \nGets the error's code. \n\n### domain\n\n```c++\nconst std::string & domain() const \n``` \nGets the domain of the error. \n\n### message\n\n```c++\nconst std::string & message() const \n``` \nGets the message describing the error. \n\n### operator=\n\n```c++\nAdError & operator=(\n const AdError & obj\n)\n``` \nAssignment operator. \n\n### response_info\n\n```c++\nconst ResponseInfo & response_info() const \n``` \nGets the [ResponseInfo](/admob/cpp/reference/class/firebase/gma/response-info#classfirebase_1_1gma_1_1_response_info) if an error occurred during a loadAd operation.\n\nThe [ResponseInfo](/admob/cpp/reference/class/firebase/gma/response-info#classfirebase_1_1gma_1_1_response_info) will have empty fields if this [AdError](/admob/cpp/reference/class/firebase/gma/ad-error#classfirebase_1_1gma_1_1_ad_error) does not represent an error stemming from a load ad operation. \n\n### \\~AdError\n\n```c++\nvirtual ~AdError()\n``` \nDestructor."]]