User id module: adds a catch to greedy promise
Type of change
-
[X] Bugfix
-
[ ] Feature
-
[ ] New bidder adapter
-
[ ] Code style update (formatting, local variables)
-
[ ] Refactoring (no functional changes, no api changes)
-
[ ] Build related changes
-
[ ] CI related changes
-
[ ] Does this change affect user-facing APIs or examples documented on http://prebid.org?
-
[ ] Other
Description of change
Errors that occur currently throw an Uncaught promise error on page. This adds a catch to avoid the error and logs as well for debugging
Other information
@dgirardi @patmmccann Not sure if it's helpful, but I experienced this uncaught promise error when calling refreshUserIds twice in quick succession. I was able to eliminate the error by removing one of those calls (it wasn't necessary anymore). It was on my to-do list to raise this up in a Git issue to have the promise fail more gracefully or provide some sort of error context. I was able to reproduce consistently in Chrome. I can probably dig up an old bundle if that's helpful, let me know.
I am able to reproduce on every page load:
- set up a network request redirect from
https://at.cbsi.com/lib/dist/prod/bidbarrel-maxpreps.min.jstohttps://at.cbsi.com/lib/dist/v3.19.0/all/bidbarrel-maxpreps.js - visit https://www.maxpreps.com
- check local storage
fmscw_respforvalue.fms_params.fms_UID2 - if it doesn't exist then you need to log in with an account
- once that
fms_UID2object exists, check the console error logs forUncaught (in promise) {}
@coreyb-cbs could you verify if the issue still happens after https://github.com/prebid/Prebid.js/pull/12246?