Avoid NPE in case of a JS Error
Put the JS error and its stracktrace into the debug output