Skip to main content
Version: 5.x.x

Error Handling

In case where an ad fails to load or display, BlueStack provides the following exceptions in error callback.

ExceptionError codeMessageMeaning
WrongPlacementIdErrorWRONG_PLACEMENT_ERROR = 0Wrong placementYou have set a wrong placement
InternetErrorNO_INTERNET_ERROR = 1No InternetThere is no internet connection at the moment
SDKUninitializedErrorSDK_UNINITIALIZED_ERROR = 2BlueStack is not initializedYou need to initialize the SDK first
RequestCappedErrorCAPPED_REQUEST_ERROR = 3Your request has been cappedYour request is capped, If you are in doubt, check your capping value related to the placement
LockedPlacementErrorLOCKED_PLACEMENT_ERROR = 4This placement is locked by an other factoryAn other factory has loaded an ad using this placement, and its no yet displayed
BusyFactoryErrorBUSY_FACTORY_ERROR = 5Your factory is busyYour factory is busy by an other request at the moment
NoAdErrorNO_AD_ERROR = 7No Ad foundTherese no ad to dilver at the moment
AlreadyShownInterstitialErrorINTERSTITIAL_ALREADY_SHOWN_ERROR = 9Other Interstitial is shownWe tolerate only one interstitial to be shown at time
TimeOutErrorTIME_OUT_ERROR = 10no ad to deliver before time outTherese no ad to deliver before the specified time out
AdapterNotFoundErrorADAPTER_NOT_FOUND_ERROR = 11SDK didn't able to find the mediation adapter for the ad network. Please check Our Mediation Partners section

Handle Error : To determine which exception was triggered, cast the exception to AdError in the fail callback and use getErrorCode() to retrieve the error code. You can also get the exception message by calling getMessage(). In the example below, we use onAdFailToLoad, but this logic can be applied to any fail callback, such as onAdFailToRefresh, onAdFailedToDisplay, infeedDidFail and nativeObjectDidFail etc.

@Override
public void onAdFailedToLoad(Exception e) {
AdError adError = (AdError)e;

switch (adError.getErrorCode())
{
case AdError.BUSY_FACTORY_ERROR :
case AdError.INTERSTITIAL_ALREADY_SHOWN_ERROR :
.
.
.
}
Log.e(TAG, "Banner did fail : " + adError.getMessage()+" error code "+adError.getErrorCode());
}