Handle javascript exceptions "gracefully"

The error message itself might need a bit of tweaking, but it's good to
at least have interesting information from the JS engine