Prebid.js
Prebid.js copied to clipboard
Uncaught JSON.parse error causes test failures
Type of issue
- Test failure
Description
A JSON.parse statement in the sharethrough adapter occasionally raises Uncaught SyntaxError and causes tests to fail

Steps to reproduce
- Run
gulp serve --watch(may need to reload page a few times) and check dev console in the invoked browser
Platform details
Prebid 0.21.0, node v7.8.0, Chrome 57. The failure probably happens on multiple platforms
Other information
This can be be fixed with something like
try {
bidResponse = JSON.parse(bidResponse);
} catch (error) {
utils.logError(error);
// or handle error how you'd prefer
}
cc @rizhang