# Class AdError

java.lang.Object
com.codename1.ads.AdError

public class AdError extends Object
Describes a failure delivered to `AdListener.onFailedToLoad(AdError)` or `AdListener.onShowFailed(AdError)`. The numeric `getCode()` and `getDomain()` are provider specific (e.g. the underlying SDK error code), while `getMessage()` is a human readable description.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `CODE_INTERNAL`
  Generic internal error code.
  `static final int`
  `CODE_INVALID_REQUEST`
  Error code used when the request was rejected as invalid (e.g. a bad ad unit id).
  `static final int`
  `CODE_NETWORK_ERROR`
  Error code used when the network was unavailable.
  `static final int`
  `CODE_NO_FILL`
  Error code used when no ad was available to fill the request.
  `static final int`
  `CODE_UNSUPPORTED`
  Error code used when no ad provider is installed or the format is unsupported.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AdError(int code, String domain, String message)`
  Creates a new error.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getCode()`
  The provider specific numeric error code.
  `String`
  `getDomain()`
  The provider specific error domain, may be null.
  `String`
  `getMessage()`
  A human readable description of the failure.
  `String`
  `toString()`
  Returns a string representation of the object.

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### CODE_NO_FILL

    public static final int CODE_NO_FILL
    Error code used when no ad was available to fill the request.
    See Also:
      - Constant Field Values

  - ### CODE_NETWORK_ERROR

    public static final int CODE_NETWORK_ERROR
    Error code used when the network was unavailable.
    See Also:
      - Constant Field Values

  - ### CODE_INVALID_REQUEST

    public static final int CODE_INVALID_REQUEST
    Error code used when the request was rejected as invalid (e.g. a bad ad unit id).
    See Also:
      - Constant Field Values

  - ### CODE_UNSUPPORTED

    public static final int CODE_UNSUPPORTED
    Error code used when no ad provider is installed or the format is unsupported.
    See Also:
      - Constant Field Values

  - ### CODE_INTERNAL

    public static final int CODE_INTERNAL
    Generic internal error code.
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### AdError

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

    Creates a new error.

    ###### Parameters

    - `code`: the provider specific error code
    - `domain`: the provider specific error domain or null
    - `message`: a human readable description

- ## Method Details

  - ### getCode

    public int getCode()
    The provider specific numeric error code.

  - ### getDomain

    public String getDomain()
    The provider specific error domain, may be null.

  - ### getMessage

    public String getMessage()
    A human readable description of the failure.

  - ### toString

    public String toString()
    Description copied from class: `Object`
    Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method. The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: getClass().getName() + '@' + Integer.toHexString(hashCode())
    Overrides:
      `toString` in class `Object`