LPS-45238 Passing the failure function directly as done elsewhere in javascript.js