usage of javascript for error reporting