# firebase::gma::AdError


`#include <types.h>`

Information about why an ad operation failed.

## Summary

| ### Constructors and Destructors ||
|---|---|
| `https://developers.google.com/admob/cpp/reference/class/firebase/gma/ad-error#classfirebase_1_1gma_1_1_ad_error_1a1b94324ddc1ab32649bca69ac30eeabb()` Default Constructor. ||
| `https://developers.google.com/admob/cpp/reference/class/firebase/gma/ad-error#classfirebase_1_1gma_1_1_ad_error_1a77580c82486072f1df1845d359a13019(const https://developers.google.com/admob/cpp/reference/class/firebase/gma/ad-error#classfirebase_1_1gma_1_1_ad_error & ad_error)` Copy Constructor. ||
| `https://developers.google.com/admob/cpp/reference/class/firebase/gma/ad-error#classfirebase_1_1gma_1_1_ad_error_1a35cd7b4e801b8b6dd066a0276dab9665()` Destructor. ||

| ### Public static attributes ||
|---|---|
| `https://developers.google.com/admob/cpp/reference/class/firebase/gma/ad-error#classfirebase_1_1gma_1_1_ad_error_1aab24d46d221e40b709989dce691d57e3` | `const char *const` A domain string which represents an undefined error domain. |

| ### Public functions ||
|---|---|
| `https://developers.google.com/admob/cpp/reference/class/firebase/gma/ad-error#classfirebase_1_1gma_1_1_ad_error_1a9bcb2bd806deefc686620cd464b456f9() const ` | `std::unique_ptr< https://developers.google.com/admob/cpp/reference/class/firebase/gma/ad-error#classfirebase_1_1gma_1_1_ad_error >` Retrieves an [AdError](https://developers.google.com/admob/cpp/reference/class/firebase/gma/ad-error#classfirebase_1_1gma_1_1_ad_error) which represents the cause of this error. |
| `https://developers.google.com/admob/cpp/reference/class/firebase/gma/ad-error#classfirebase_1_1gma_1_1_ad_error_1a73725ef1c72109d1999555322064163d() const ` | `virtual const std::string &` Returns a log friendly string version of this object. |
| `https://developers.google.com/admob/cpp/reference/class/firebase/gma/ad-error#classfirebase_1_1gma_1_1_ad_error_1a0a47204c474803b9750526404b92c329() const ` | `https://developers.google.com/admob/cpp/reference/namespace/firebase/gma#namespacefirebase_1_1gma_1ac19d849edf4632e40563c52546ef7e14` Gets the error's code. |
| `https://developers.google.com/admob/cpp/reference/class/firebase/gma/ad-error#classfirebase_1_1gma_1_1_ad_error_1a74009bc70cd1531c52cf53c3ddbf5669() const ` | `const std::string &` Gets the domain of the error. |
| `https://developers.google.com/admob/cpp/reference/class/firebase/gma/ad-error#classfirebase_1_1gma_1_1_ad_error_1a6cb8f560c3937d1e4b9f7085d261be30() const ` | `const std::string &` Gets the message describing the error. |
| `https://developers.google.com/admob/cpp/reference/class/firebase/gma/ad-error#classfirebase_1_1gma_1_1_ad_error_1a585377077c9fb224163e295eb7025780(const https://developers.google.com/admob/cpp/reference/class/firebase/gma/ad-error#classfirebase_1_1gma_1_1_ad_error & obj)` | `https://developers.google.com/admob/cpp/reference/class/firebase/gma/ad-error#classfirebase_1_1gma_1_1_ad_error &` Assignment operator. |
| `https://developers.google.com/admob/cpp/reference/class/firebase/gma/ad-error#classfirebase_1_1gma_1_1_ad_error_1ad31570534f7c9c8098fba6861454fa61() const ` | `const https://developers.google.com/admob/cpp/reference/class/firebase/gma/response-info#classfirebase_1_1gma_1_1_response_info &` Gets the [ResponseInfo](https://developers.google.com/admob/cpp/reference/class/firebase/gma/response-info#classfirebase_1_1gma_1_1_response_info) if an error occurred during a loadAd operation. |

## Public static attributes

### kUndefinedDomain

```c++
const char *const kUndefinedDomain
```
A domain string which represents an undefined error domain.

The GMA SDK returns this domain for [domain()](https://developers.google.com/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.

## Public functions

### AdError

```c++
 AdError()
```
Default Constructor.

### AdError

```c++
 AdError(
  const AdError & ad_error
)
```
Copy Constructor.

### GetCause

```c++
std::unique_ptr< AdError > GetCause() const 
```
Retrieves an [AdError](https://developers.google.com/admob/cpp/reference/class/firebase/gma/ad-error#classfirebase_1_1gma_1_1_ad_error) which represents the cause of this error.

<br />

| Details ||
|---|---|
| **Returns** | a pointer to an adError which represents the cause of this [AdError](https://developers.google.com/admob/cpp/reference/class/firebase/gma/ad-error#classfirebase_1_1gma_1_1_ad_error). If there was no cause then nullptr is returned. |

### ToString

```c++
virtual const std::string & ToString() const 
```
Returns a log friendly string version of this object.

### code

```c++
AdErrorCode code() const 
```
Gets the error's code.

### domain

```c++
const std::string & domain() const 
```
Gets the domain of the error.

### message

```c++
const std::string & message() const 
```
Gets the message describing the error.

### operator=

```c++
AdError & operator=(
  const AdError & obj
)
```
Assignment operator.

### response_info

```c++
const ResponseInfo & response_info() const 
```
Gets the [ResponseInfo](https://developers.google.com/admob/cpp/reference/class/firebase/gma/response-info#classfirebase_1_1gma_1_1_response_info) if an error occurred during a loadAd operation.

The [ResponseInfo](https://developers.google.com/admob/cpp/reference/class/firebase/gma/response-info#classfirebase_1_1gma_1_1_response_info) will have empty fields if this [AdError](https://developers.google.com/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.

### \~AdError

```c++
virtual  ~AdError()
```
Destructor.