Skip to content

Script breaks when Wrapper-VASTAdTagURI fails #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ghost opened this issue Jun 23, 2014 · 2 comments
Open

Script breaks when Wrapper-VASTAdTagURI fails #7

ghost opened this issue Jun 23, 2014 · 2 comments

Comments

@ghost
Copy link

ghost commented Jun 23, 2014

If VAST is a wrapper, and the VASTAdTagURI fails (e.g. due to missing CORS), onLoaded breaks, consequently the queryVAST onFetched callback is never called. onLoaded expects ads to be populated, there is no error checking in there.

(Possible solution, and workaround for me locally: If ads arrives as null in onLoaded, this.loaded is be set to true anyway and onAdAvailable is called, so errors could still be tracked, but I'm not sufficiently familiar with the recursion mechanism to actually decide this.)

@jonhoo
Copy link
Owner

jonhoo commented Aug 16, 2014

Hmm, I think you're on the right track with this.loaded = true and then calling onAdsAvailable. This will propagate out to the calling script which could then detect the error quite easily. The documentation for onAdsAvailable would have to be changed to say something along the lines of "this function should check that the list of available ads is non-empty which it might be in case of an error". I think we should also add a VastAds.errors = [] which will be pushed to when new errors are encountered that the developer can use for debugging purposes.

@jonhoo
Copy link
Owner

jonhoo commented Jul 7, 2015

This is partially fixed by 018ba4f / #13 in that a callback is at least called. There's currently no reporting of what the error was, though that should be fairly straightforward to add.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant