AdError

public class AdError extends Object
Known Direct Subclasses

Error information about why an ad operation failed.

Constant Summary

String UNDEFINED_DOMAIN The undefined error domain.

Public Constructor Summary

AdError(int code, String message, String domain)
Creates an AdError.
AdError(int code, String message, String domain, AdError cause)
Creates an AdError with an underlying cause.

Public Method Summary

AdError
getCause()
Gets the cause of this error or null if the cause is nonexistent or unknown.
int
getCode()
Gets the error's code.
String
getDomain()
Gets the domain of the error.
String
getMessage()
Gets the message describing the error.

Inherited Method Summary

Constants

public static final String UNDEFINED_DOMAIN

The undefined error domain.

The Google Mobile Ads SDK returns this domain for getDomain() when converting error information from legacy mediation adapter callbacks like onFailure(String) to an AdError.

Constant Value: "undefined"

Public Constructors

public AdError (int code, String message, String domain)

Creates an AdError.

Parameters
code the error code.
message a message detailing the error.
domain the error domain.

public AdError (int code, String message, String domain, AdError cause)

Creates an AdError with an underlying cause.

Parameters
code the error code.
message a message detailing the error.
domain the error domain.
cause the cause of this error. Use AdError(int, String, String) if the cause is nonexistent or unknown.

Public Methods

public AdError getCause ()

Gets the cause of this error or null if the cause is nonexistent or unknown.

public int getCode ()

Gets the error's code.

public String getDomain ()

Gets the domain of the error.

Returns
  • ERROR_DOMAIN for Google Mobile Ads SDK errors, or a domain defined by mediation networks for mediation errors.

public String getMessage ()

Gets the message describing the error.