# BannerAd.onError(function callback)
Listens on the banner ad error event.
# Parameters
# function callback
The callback function for the banner ad error event.
# Parameters
# Object res
Property | Type | Description | Minimum Version |
---|---|---|---|
errMsg | string | Error message | |
errCode | number | Error code | 2.2.2 |
Valid values of errCode
Value | Description | Minimum Version |
---|---|---|
1000 | Backend API call failed | |
1001 | Parameter error | |
1002 | Invalid ad unit | |
1003 | Internal error | |
1004 | No suitable ad | |
1005 | Ad component under review | |
1006 | Ad component rejected | |
1007 | Ad component banned | |
1008 | Ad unit disabled |
# Error Codes and Solutions
The error code is obtained via onError. During debugging, you can capture information based on unusual return values. If an exception occurs after the Mini Program is launched, you can search the error log in the "O&M Center". You can also add appropriate monitoring information for unusual return values.
Code | Exception | Cause | Solution |
---|---|---|---|
1000 | Call failed due to a backend error | This error is not caused by the developer's abnormal operation. | Ignore the error, and it will be automatically recovered after a period of time. |
1001 | Parameter error | Incorrect usage | You can go to developers.weixin.qq.com and refer to the specific tutorial. (There are tutorials for Mini Programs and Mini Games, which can be switched to on the right side of the Design column in the top options.) |
1002 | Invalid ad unit | The spelling may be incorrect or the ad ID of another app may be used. | Go to mp.weixin.qq.com to confirm the advertising space ID. |
1003 | Internal error | This error is not caused by the developer's abnormal operation. | Ignore the error, and it will be automatically recovered after a period of time. |
1004 | No suitable ad | The ad does not appear every time. Maybe it is not appropriate to the user. | This is a normal event and the developer must adjust styles for compatibility. |
1005 | Ad component under review | Your ad is still under review and cannot be displayed. | Go to mp.weixin.qq.com to confirm the review status. The developer must adjust styles for compatibility. |
1006 | Ad component rejected | Your ad failed to pass the review and cannot be displayed. | Go to mp.weixin.qq.com to confirm the review status. The developer must adjust styles for compatibility. |
1007 | Ad component banned | Your ad has been banned and cannot be displayed for the duration of the ban. | Go to mp.weixin.qq.com to confirm that the Mini Program ad is banned. |
1008 | Ad unit disabled | The capability of this ad space to display ads has been disabled. | Go to mp.weixin.qq.com to enable the appropriate ad space to display ads again. |