google.ima.AdError

941 views
Skip to first unread message

Rod

unread,
Mar 2, 2016, 1:16:59 AM3/2/16
to Interactive Media Ads SDK, Victor Vazquez, Raymundo Segovia
Hi,

We've been trying to be able to catch all the different error codes that may happen at different times
while using IMA SDK V3, however it's been a bit difficult to understand the correct usage of google.ima.AdError class in order to access it's methods.

It would be much appreciated if you could help us with a simple example on how to implement this class and the correct moment when it should be instantiated in order to get all error codes.

Thank you very much.


Adrenaline team.

Vu Chau (IMA SDK Team)

unread,
Mar 2, 2016, 1:55:05 PM3/2/16
to Interactive Media Ads SDK, vic...@adrenaline.com.mx, raym...@adrenaline.com.mx
Hi Rod,

You don't have to implement google.ima.AdError for the purpose of getting the ad error codes.  You can use getError() from google.ima.AdErrorEvent because it returns an ad error from google.ima.AdError.  For example:
function onAdError(adErrorEvent) {
   // Handle the error logging.
   var error = adErrorEvent.getError(); 
   console.log("Error - " + error.toString());
   console.log("getErrorCode() - " + error.getErrorCode());
   console.log("getInnerError() - " + error.getInnerError());
   console.log("getMessage() - " + error.getMessage());
   console.log("getType() - " + error.getType());
   console.log("getVastErrorCode() - " + error.getVastErrorCode());
   adsManager.destroy();
}
will return something like:
Error - AdError 403: Linear assets were found in the VAST ad response, but none of them matched the video player's capabilities.
getErrorCode() - 403
getInnerError() - undefined
getMessage() - Linear assets were found in the VAST ad response, but none of them matched the video player's capabilities.
getType() - adPlayError
getVastErrorCode() - 403
Let us know if you have additional questions,

Vu Chau
IMA SDK Team

Rodrigo Marcor

unread,
Mar 3, 2016, 11:38:36 AM3/3/16
to ima...@googlegroups.com
Thank you very much for you help really!


Best regards!

Adrenaline Team.

--
You received this message because you are subscribed to a topic in the Google Groups "Interactive Media Ads SDK" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ima-sdk/0RWT41CAmsc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ima-sdk+u...@googlegroups.com.
To post to this group, send email to ima...@googlegroups.com.
Visit this group at https://groups.google.com/group/ima-sdk.
For more options, visit https://groups.google.com/d/optout.

Sebastian

unread,
Jul 29, 2016, 8:17:13 AM7/29/16
to Interactive Media Ads SDK
Hi there,

Is it necessary to call adsManager.destroy in AdError listener?

Doing so will destroy the playlist entirely. My first approach was not using destroy(), hopping the left ads from a playlist will load and run fine.

Cheers,
Sebi

Vu Chau (IMA SDK Team)

unread,
Jul 29, 2016, 10:20:15 AM7/29/16
to Interactive Media Ads SDK
Hi Sebastian,

Calling adsManager.destroy() (which is invoked for fatal errors) even in playlist scenarios should be fine for your remaining ads.  In a playlist, if an ad is faulty, we throw a non-fatal error instead (basically a log event) and move on.  That way, your remaining ads in the playlist will still get to play.

That means none of the error events I gave Rodrigo will be called for you.  If you still wish to obtain information for non-fatal errors, check out getAdData().

Vu Chau
IMA SDK Team

Sebastian

unread,
Jul 29, 2016, 11:27:25 AM7/29/16
to Interactive Media Ads SDK
Thank you!
Reply all
Reply to author
Forward
0 new messages