Prebid.js icon indicating copy to clipboard operation
Prebid.js copied to clipboard

Uncaught JSON.parse error causes test failures

Open matthewlane opened this issue 9 years ago • 0 comments

Type of issue

  • Test failure

Description

A JSON.parse statement in the sharethrough adapter occasionally raises Uncaught SyntaxError and causes tests to fail error

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

matthewlane avatar Apr 11 '17 16:04 matthewlane