BL-697: Improve handling of JavaScript errors
Merge pull request #143 from phillip-hopper/BL-697

BL-697: Improve handling of JavaScript errors